Outlook 2003 vs. 2000 / HTMLBody Property

F

Fred Block

Hi All,

I've written an application in VB6 that creates an email in Outlook 2003 and
the code utilizes the MailItem's HTMLBody property. When I compile the
application, the type library references the "Microsoft Outlook 11.0 Object
Library" (on my development machine). When the application is deployed,
user(s) running Outlook 2000 cannot use this feature of my application.
These users do not get an error message but the application displays an
hourglass which doesn't go away. The application does not freeze and you can
click something esle within the GUI to reset the "works" of the application.
For the Outlook 2003 user(s), everything works just fine.

Is the problem with referring to the Outlook 2003 type library, my code (see
below), or something completely different?

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
' Create email item.
Set objMail = olApp.CreateItem(olMailItem)

With objMail
.Subject = "HTML Email Body Dev Test"
.BodyFormat = olFormatHTML
.HTMLBody = GetEmailHTMLBody ' Set body format to HTML
.Display
End With

Thanks in advance!
- Fred
 
M

Michael Bauer [MVP - Outlook]

Am Fri, 4 Aug 2006 10:36:58 -0400 schrieb Fred Block:

OL 2000 doesn´t know the BodyFormat property. If you want to add a ref to an
Outlook library to your project then you need to use the oldest library
which you want to support.
 
F

Fred Block

Hi Michael,
OL 2000 doesn´t know the BodyFormat property. If you want to add a ref to
an
Outlook library to your project then you need to use the oldest library
which you want to support.

Thanks for the reply!

You stated the "BodyFormat" property... Is this the same or different
property than the "HTMLBody" property?

Also - is it possible to temporarily replace the type library on my
development machine with an Outlook 2000 version in order to get this
application to compile correctly (assuming that the EXE will then play nice
with the older Outlook 2000 version vs. the Outlook 2003 version)?

Thanks again in advance!
- Fred
 
M

Michael Bauer [MVP - Outlook]

Am Sat, 5 Aug 2006 21:48:40 -0400 schrieb Fred Block:

Please have a look at your original post/code: BodyFormat and HTMLBody are
quite different. For details please see the VBA help.

I don´t think that replacing a TLB would work. If you do have both versions
then you could use a virtual pc (Virtual PC from Microsoft or VMWare) and
compile on that again.
 
F

Fred Block

Hi Michael,
Please have a look at your original post/code: BodyFormat and HTMLBody are
quite different. For details please see the VBA help.

Ooops! missed that. Thanks for all of your help!

So the bottom line is... can I use HTML in Outlook 2000 from VB?

Thanks again!
- Fred
 
M

Michael Bauer [MVP - Outlook]

Am Mon, 7 Aug 2006 11:38:43 -0400 schrieb Fred Block:


Hi Michael,


Ooops! missed that. Thanks for all of your help!

So the bottom line is... can I use HTML in Outlook 2000 from VB?

Thanks again!
- Fred

Yes, simply write into the HTMLBody property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top