Hi Ross
got error in outlook 2007, in instruction send
Here is the error
Application-defined or object-defined error
This code works in outlook 2007
Shell "outlook.exe", vbMinimizedFocus
Dim oApp As Outlook.Application
Dim oEmail As MailItem
Dim colAttach As Outlook.Attachments
Dim oAttach As Outlook.Attachment
Set oApp = CreateObject("Outlook.Application")
Set oEmail = oApp.CreateItem(olMailItem)
oEmail.HTMLBody = "ola" & "<img src=""c:\senhora.jpg"" > " & vbNewLine
oEmail.Save
oEmail.Display
oEmail.To = "myemail"
oEmail.Subject = "Teste ao envio de email"
oEmail.Send
'MsgBox "terminei"
Set oEmail = Nothing
Set colAttach = Nothing
Set oAttach = Nothing
Set oApp = Nothing
Shell "taskkill /F /IM outlook.exe", vbHide
But I don't like it because I have to open outlook and kill the process.
Any ideas?
Bookmarks