Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook signature missing image when message generated from Access

Status
Not open for further replies.

VBAPrincess

Programmer
Feb 6, 2004
79
US
I have an Access application that creates an Outlook email message and populates the message with the user's default signature. Recently my users created new standardized signatures with our new logo in it. When the emails are created from Access, the image does not appear and has a red x. If you create a new email in Outlook, the signature appears just fine. I don't know if the issue is with Access or Outlook.

Access creates the message using MAPI and captures the signature file using a procedure GetBoiler which uses FSO to read the contents of the HTM file used for the signature. The body of the message including the signature is populated in the message and then the message is made visible to the user so he/she can edit prior to sending. This process has worked fine in the past but the signatures did not contain images.

I have recreated the signature by manually writing the HTML because the signatures were originally created by someone else and when my users did a copy/paste, the file had all sorts of extra Word HTML crap.

We're using Outlook 2007 SP2, XP Pro SP2, and Office 2003 (only Outlook is 2007). The image is a GIF.

TIA for any help!

Diana
VBA Princess
-- I'm hoping to grow up to be a Goddess!
 
Email clients convert and embed the images into the message as base64 code as the message is created.

Access won't be doing this bit.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks Chris! [smile] I actually found a solution and it turned out to be rather simple. Not sure why I didn't implement this when I orginally wrote the code, but I was probably more concerned at the time with the Outlook security issues/msgs to focus on the signature portion. I grabbed the GetBoiler function and ran with it rather than find a simpler solution.

Here's how I solved the problem:
1. Create the new mail message with To, Subject, and CC if needed.
2. Save the email message and then display it. Outlook will automatically insert the default signature.
3. Add my attachments.
4. Use the following code to add the content of the message AND keep the previously inserted signature.
Code:
objMail.HTMLBody = strBody & objMail.HTMLBody

The Save part in #2 isn't necessary but doesn't hurt either.

Again, amazingly simple but took me a while to find. Since there is no way thru the Outlook object model to access signatures, I just had to step back, let Outlook do its thing, and then go on.

HTH someone else! [thumbsup]

Diana
VBA Princess
-- I'm hoping to grow up to be a Goddess!
 
I had an issue similar to this and my work around was to put the data in the body using text positioning

With MailItem
.Display
.GetInspector.WordEditor.Range(Start:=0, End:=0).Paste
End With

No need to capture anyone's signature (populated with Display).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top