
Trouble with Outlook 2002 (XP)
I've just found the problem, and this seems to be a bug. Does someone
confirm this?
If I write :
Sub Teste01()
Dim oMsg As MailItem
Set oMsg = CreateItem(olMailItem)
oMsg.Body = "foo"
oMsg.HTMLBody = "<html><body><b>um body </b>somente para
testes</body></html>"
oMsg.Subject = "teste2"
oMsg.Save
End Sub
this works fine!!! I have to write something on Body before using HTMLBody.
Rafael Cotta
Quote:
> I think the line:
> Set oMsg = CreateItem(olMailItem)
> might be the problem.
> Do you end up with the same results when using...
> Set oMsg = Application.CreateItem(olMailItem)
> > Hi all,
> > I am really in trouble.
> > I'm with Office XP trial installed, and tried to run the following code:
> > Sub Teste01()
> > Dim oMsg As MailItem
> > Set oMsg = CreateItem(olMailItem)
> > oMsg.HTMLBody = "<html><body><b>um body </b>somente para
> > testes</body></html>"
> > oMsg.Subject = "teste2"
> > oMsg.Save
> > End Sub
> > As you can see, the code is quite simple. But doesn't work!!!
> > Although the message is saved, body is left blank!!!
> > If I use only Body instead of HTMLBody this works fine (without
formatted
> > text).
> > What am I doing wrong??????????????????????/
> > Thanks in advance,
> > Rafael