Creating an HTML message in this manor:
Set olapp = CreateObject("Outlook.Application")
Set olNamespace = olapp.GetNamespace("MAPI")
Set olfolder = olNamespace.GetDefaultFolder(olFolderInbox)
Set olMailItem = olfolder.Items.Add("IPM.Note")
Set olattach = olMailItem.Attachments
'
With olMailItem
.Subject = "Work Order #" & WorkOrder & " closed!"
.To = DLookup("InvoiceEmailAddress", "Config")
.CC = DLookup("InvoiceEmailAddressCC", "Config")
.BodyFormat = olFormatHTML
.HTMLBody = strBodyText
.Importance = olImportanceHigh 'High importance
End With
'You can add more than one attachment by useing the same line of code below
'olattach.Add ""
olMailItem.Send 'you can change this to olMailItem.Display if required
Set objSafeMail = Nothing
Set olMailItem = Nothing
Set olfolder = Nothing
Set olNamespace = Nothing
Set olapp = Nothing
=======================
Okay, that works well and the received email looks great, except when it goes through some sort of filter program in India and sent back to us in RTF format.
If strBodyText contained HTML code to change the color to RED ("<FONT " & Chr(34) & " COLOR=" & Chr(34) & "#FF0000" & Chr(34) & ">"), every character after that is now missing from the converted message, until I change the color back to black ("<FONT " & Chr(34) & " COLOR=" & Chr(34) & "#000000" & Chr(34) & ">").
Does this make any sense? Probably not <grin>.
The HTML format codes for bold and underline work great ("<B>") along with lineend ("<BR>") and a few others that I am using.
It there alternative HTML color codes that I could use that would filter back to RTF okay? Is there an easy way to use RTF color codes in an HTML message?
Maybe this problem is with what-ever filter program they are uing in India or those HTML color codes just are not compatable with RTF?
HTML is easy; I know very little about RTF and I don't understand how all the other formatting is remaining in tact.
Set olapp = CreateObject("Outlook.Application")
Set olNamespace = olapp.GetNamespace("MAPI")
Set olfolder = olNamespace.GetDefaultFolder(olFolderInbox)
Set olMailItem = olfolder.Items.Add("IPM.Note")
Set olattach = olMailItem.Attachments
'
With olMailItem
.Subject = "Work Order #" & WorkOrder & " closed!"
.To = DLookup("InvoiceEmailAddress", "Config")
.CC = DLookup("InvoiceEmailAddressCC", "Config")
.BodyFormat = olFormatHTML
.HTMLBody = strBodyText
.Importance = olImportanceHigh 'High importance
End With
'You can add more than one attachment by useing the same line of code below
'olattach.Add ""
olMailItem.Send 'you can change this to olMailItem.Display if required
Set objSafeMail = Nothing
Set olMailItem = Nothing
Set olfolder = Nothing
Set olNamespace = Nothing
Set olapp = Nothing
=======================
Okay, that works well and the received email looks great, except when it goes through some sort of filter program in India and sent back to us in RTF format.
If strBodyText contained HTML code to change the color to RED ("<FONT " & Chr(34) & " COLOR=" & Chr(34) & "#FF0000" & Chr(34) & ">"), every character after that is now missing from the converted message, until I change the color back to black ("<FONT " & Chr(34) & " COLOR=" & Chr(34) & "#000000" & Chr(34) & ">").
Does this make any sense? Probably not <grin>.
The HTML format codes for bold and underline work great ("<B>") along with lineend ("<BR>") and a few others that I am using.
It there alternative HTML color codes that I could use that would filter back to RTF okay? Is there an easy way to use RTF color codes in an HTML message?
Maybe this problem is with what-ever filter program they are uing in India or those HTML color codes just are not compatable with RTF?
HTML is easy; I know very little about RTF and I don't understand how all the other formatting is remaining in tact.