IrishCharm
05-14-2008, 05:01 AM
Hi,
I have an automated email function which sends out a string message and attaches a html signature to the end of the mail (saved in c drive as mysig).
However there are funny symbols which keep appearing between the signature and message and i can not understand it. Any help would be great - i am using Excel and Outlook 2003
Kind regards,
Sarah
Sub SendMessage()
SigString = "C:\Documents and Settings\duffsa\Application Data\Microsoft\Signatures\MySig.htm"
str_subject = "HELLO WORLD"
str_body = "TEST MAIL"
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(SigString).openastextstream(1, -2)
Signature = ts.readall
Set objOutlook = CreateObject("outlook.application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add("MY EMAIL ADDRESS")
.Subject = str_subject
.htmlBody = "<html><body>" & str_body & "<br><br>" & Signature
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
.Display
End With
End Sub
I have an automated email function which sends out a string message and attaches a html signature to the end of the mail (saved in c drive as mysig).
However there are funny symbols which keep appearing between the signature and message and i can not understand it. Any help would be great - i am using Excel and Outlook 2003
Kind regards,
Sarah
Sub SendMessage()
SigString = "C:\Documents and Settings\duffsa\Application Data\Microsoft\Signatures\MySig.htm"
str_subject = "HELLO WORLD"
str_body = "TEST MAIL"
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(SigString).openastextstream(1, -2)
Signature = ts.readall
Set objOutlook = CreateObject("outlook.application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add("MY EMAIL ADDRESS")
.Subject = str_subject
.htmlBody = "<html><body>" & str_body & "<br><br>" & Signature
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
.Display
End With
End Sub