Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 8th, 2004, 03:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default BodyFormat = olFormatHTML

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.
======================================
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.