No email stationery when through code

J

John

Hi

I am creating email via code from access using below;

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
objOutlookMsg.To = "(e-mail address removed)"
objOutlookMsg.Subject = "Email Subject"
objOutlookMsg.Body = "Dear abc..."
objOutlookMsg.Display

The problem is that the default signature that is set in outlook doe snot
come up in the email. How can I fix it?

Thanks

Regards
 
M

Michael Bauer [MVP - Outlook]

Am Sun, 17 Sep 2006 21:11:45 +0100 schrieb John:

Call Display first, then insert your text before the existing the body
(instead of overwriting it).
 
J

John

Thanks. I am now using;

objOutlookMsg.Display
objOutlookMsg.BodyFormat = olFormatHTML
objOutlookMsg.Body = "Dear abc..." & objOutlookMsg.Body

The email displays fine with the signature but as soon as the text is added,
the signature formatting is lost and the signature image is replaced with a
hyperlink. How can I preserve the signature formatting while adding text
before it?

Thanks

Regards
 
M

Michael Bauer [MVP - Outlook]

Am Mon, 18 Sep 2006 06:01:22 +0100 schrieb John:

Use HTMLBody property instead of Body.
 

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