Olá galera,
Consegui um código que se, colocado num cmdbutton, abre o Outlook com endereços, assunto e até mesmo o corpo do emali preenchidos. O problema é que não consegui fazer com que o endereço seja o que está escrito no textbox do meu form. Segue o código abaixo, se alguém puder me ajudar.
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal IpOperation As String, ByVal IpFile As String, _
ByVal IpParameters As String, ByVal IpDirectory _
As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
Private Sub SendMail(Optional Adress As String, _
Optional Subject As String, Optional Body As String, _
Optional CC As String, Optional BCC As String)
Dim strCommand As String
If Len(Subject) Then strCommand = "&Subject=" & Subject
If Len(Body) Then strCommand = strCommand & "&Body=" & Body
If Len(CC) Then strCommand = strCommand & "&CC=" & CC
If Len(BCC) Then strCommand = strCommand & "&BCC=" & BCC
If Len(strCommand) Then
Mid(strCommand, 1, 1) = "?"
End If
strCommand = "mailto:" & Adress & strCommand
Call ShellExecute(Me.hwnd, "open", strCommand, vbNullString, vbNullString, SW_SHOWNORMAL)
End Sub
Private Sub CmdEmail_Click()
Call SendMail("fernando@lorenzi.com.br", "Teste", _
"Teste", "Teste")
End Sub