Hey guys,
I am trying to send an email with my signature on it.
Everything works perfectly, but the picture does not load.
Here is my code:
Sub testemail()
'-----------------------------------------
'DETERMINE IF EMAIL TO BE SENT
If MsgBox("Send Email?", vbYesNo + vbQuestion, "Email") = vbYes Then
'-----------------------------------------
'DECLARE AND SET VARIABLES
Dim myOutlok As Object
Dim myMailItm As Object
Dim Signature As String
Shell ("OUTLOOK")
Set otlApp = CreateObject("Outlook.Application")
Set OtlNewMail = otlApp.CreateItem(olMailItem)
'-----------------------------------------
'GET DEFAULT EMAIL SIGNATURE
Signature = "C:/Users/joao/AppData/Roaming/Microsoft/Assinaturas/Joćo.htm"
If Dir(Signature, vbDirectory) <> vbNullString Then
Signature = Signature & Dir$(Signature & "Joćo*.htm")
Else:
Signature = ""
End If
Signature = CreateObject("Scripting.FileSystemObject").GetFile(Signature).OpenAsTextStream(1, -2).ReadAll
'-----------------------------------------
'CREATE EMAIL
OtlNewMail.HTMLBody = Signature
With OtlNewMail
.To = "[email protected]"
.CC = Range("H10").Value
.Subject = "Oi"
.HTMLBody = "Hello," & "<br />" & Range("H12").Value & "<br />" & "<br />" & "<br />" & _
"Thank you," & "<br />" & "<br />" & Signature
.display
'.Send
End With
'-----------------------------------------
'CLEANUP
Set OtlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
End If
End Sub
What is wrong?
Bookmarks