Trouble with Outlook 2002 (XP) 
Author Message
 Trouble with Outlook 2002 (XP)

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



Mon, 10 May 2004 02:31:47 GMT  
 Trouble with Outlook 2002 (XP)
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)


Quote:
> 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



Tue, 11 May 2004 01:19:46 GMT  
 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



Tue, 11 May 2004 03:25:05 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Outlook 2002/Outlook with Office XP

2. outlook xp 2002 keyboard map

3. Outlook XP(2002) Issue w/ using html-php email

4. Outlook 2002/Win XP, Cannot send RTF msg from VBA app

5. Outlook XP/2002 Reminders email

6. Outlook 2002/Office XP Message issue

7. HTMLBody in the Outlook 2002/XP

8. Cannot use VBA macro's in Outlook 2002 (XP)

9. Cannot use VBA macro's in Outlook 2002 (XP)

10. Always BCC in Outlook 2000/2002/XP

11. Outlook XP/2002 - Programmatically adding Sync Groups

12. VB Editor is no longer loading from Outlook 2002 / XP

 

 
Powered by phpBB® Forum Software