SHELLEXECUTE
Estou a usar o ShellExecute para enviar emaiÂÂÂ's.
qual o parametro que tenho que por neste comando para anexar um ficheiro ??
Eu estou a usar assim:
ShellExecute Me.hwnd, "Open", "mailto:" & txtemail.Text + "?subject=" & arq_anexo & "&body=" & Assunto, _
vbNullString, vbNullString, vbNormalFocus
Tks.
MS
qual o parametro que tenho que por neste comando para anexar um ficheiro ??
Eu estou a usar assim:
ShellExecute Me.hwnd, "Open", "mailto:" & txtemail.Text + "?subject=" & arq_anexo & "&body=" & Assunto, _
vbNullString, vbNullString, vbNormalFocus
Tks.
MS
Tenta assim:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Dim Arquivo As String, Ret As Long
Arquivo = "C:\boot.ini"
ShellExecute Me.hWnd, "Open", _
"mailto:martinianoduarte@hotmail.com?subject=Assunto&body=Corpo email", _
vbNullString, vbNullString, vbNormalFocus
While Ret = 0
DoEvents
Ret = FindWindow(vbNullString, "Assunto")
Wend
SendKeys "%ia" & Arquivo & "{TAB}{TAB}{ENTER}"
End Sub
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Dim Arquivo As String, Ret As Long
Arquivo = "C:\boot.ini"
ShellExecute Me.hWnd, "Open", _
"mailto:martinianoduarte@hotmail.com?subject=Assunto&body=Corpo email", _
vbNullString, vbNullString, vbNormalFocus
While Ret = 0
DoEvents
Ret = FindWindow(vbNullString, "Assunto")
Wend
SendKeys "%ia" & Arquivo & "{TAB}{TAB}{ENTER}"
End Sub
coloque só o SHELL e tire o shell execute.
O comando SendKeys, não fáz absolutamente NADA. Já tentei pà 'r só assim
(para ver se faz alguma coisa)
SendKeys "%i"
e não faza nada, simplemente abre o Outlook Express.
Tks.
MS
(para ver se faz alguma coisa)
SendKeys "%i"
e não faza nada, simplemente abre o Outlook Express.
Tks.
MS
Acredito que se vc utilizar a biblioteca vbSendmail irá resolver seu problema, pois além de não precisar que um editor externo para enviar e-mail, suporta anexos e ainda autenticação POP3 e SMTP. O endereço é: http://www.vbmania.com.br/vbmdetail.php?varID=2873
Tópico encerrado , respostas não são mais permitidas