438 error sending Outlook e-mail

James Deckert

Continuing to Learn
Local time
Today, 00:00
Joined
Oct 6, 2005
Messages
189
I'm getting an error sending e-mails using Outlook. It works fine with
Outlook 2002, but I'm getting a 438: Object doesn't support this property or
method from the Outlook 2000 system.

I'm late binding the Outlook object to help remove incompatibility issues.
I'm using Outlook so I can send HTML e-mails.

Does anyone know if there is something in my code which is not compatible
with Outlook 2000?

Following is my code.
Sub SendEMail(strRecipient As String, strSubject As String, strBody As String)
Dim objOutlook As Object
Dim objMsg As Object

Set objOutlook = CreateObject("Outlook.Application")
Const olMailItem = 0
Set objMsg = objOutlook.CreateItem(olMailItem)
strBody = Replace(strBody, vbCrLf, "<br>")
Const olFormatHTML = 2
With objMsg
.To = strRecipient
.Subject = strSubject
.BodyFormat = olFormatHTML
.HTMLBody = strBody
.Send
End With

Set objOutlook = Nothing
Set objMsg = Nothing
end sub

thanks,
James
 
What line generates the error? Also, go to a machine with Outlook 2000, set a reference to Outlook 9 (is my guess) and look around in the object browser. Can you find the members that were in the line that caused the error?
That's the process I'd use to troubleshoot.
Cheers,
 
No such luck as the Outlook 2000 system is not mine, but on a computer using my Access database which is delivered as an MDE with no code. I'm not sure but they may not have Access either but using the run-time. It is also several States away.
 
Then what degree of certainty do you have that the error even occurs in this code?
 
The error that displays for the user points back to this function, just not a specific line.
 

Users who are viewing this thread

Back
Top Bottom