Hi All,
Im getting the following error:
Code:
-2147023151: Automation error The procedure number is out of range.
On the line
Code:
.BodyFormat = olFormatHTML
in the function below.
Does anyone have any idea what this is refering to?
The code works fine when the body format is not being set.
THanks in advance for any assistance.
Code:
Sub sendFax(faxTo, faxFrom, faxSubject, faxBody, faxAttachment1, faxAttachment2)
On Error GoTo errHandler
Dim objOutlook 'As New Outlook.Application
Dim objOutlookMsg 'As Outlook.MailItem
'Create a mail item.
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = "[FAX:" & faxTo & "]"
.subject = faxFrom & ":" & faxSubject
.HTMLBody = faxBody
.Importance = olImportanceNormal
.BodyFormat = olFormatHTML
If faxAttachment1 <> "" Then Attachments.Add (faxAttachment1)
If faxAttachment2 <> "" Then Attachments.Add (faxAttachment2)
.send
End With
Set objOutlookMsg = Nothing
Exit Sub
errHandler:
MsgBox (Err.Number & ": " & Err.Description)
sendEmail "[email protected]", "[email protected]", "XML Fax Error", Err.Number & ": " & Err.Description, "", ""
Resume Next
End Sub
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================