Using Outlook Standard Email Template from Access VBA

C

CaptainBly

I have in several different applications set up the ability for a
customer to send emails from the application.

My application creates an instance of outlook. Creates an email.
Adds necessary email addresses. Adds attachments where applicable.
Adds subject and body text and sends.


That all works great.


The emails that generate are very simple plane text emails though. I
have a customer that would like it to use the email template
like Outlook does with their signature etc... on the generated emails
from Access.


They would also like the ability to "pretty up" the email. Use
different fonts. Different colors. Etc... But that is not as
pressing. The first portion is more important. Is there a way to get
their signature on an email? To use the same blank template that they
see
when they just generate an email in outlook?


Is there a way to do this from VBA?

Any help is greatly appreciated
 
S

Sue Mosher [MVP-Outlook]

Yes, that's possible. You'd need to instantiate an Outlook.Application object, then use its CreateItem() method to create your message. Add formating by setting the value of the HTMLBody property to the fully tagged HTML content that you want the message to display.
 
C

CaptainBly

Yes, that's possible. You'd need to instantiate an Outlook.Application object, then use its CreateItem() method to create your message. Add formating by setting the value of the HTMLBody property to the fully tagged HTML content that you want the message to display.
--
Sue Mosher, Outlook MVP
   Author of Microsoft Outlook 2007 Programming:
     Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54











- Show quoted text -

I am creating the emails using those objects/methods. I did see the
htmlbody property/setting and set that but the email I send doesn't
have the default signature from outlook on it. That is more
important than using fonts and stuff actually. Is there a way to add
the signature section to the outgoing email? I didn't see a property/
setting/method in the object definition that let me do that.

I really just want the email to look like they sent it natively from
their outlook session with their signature etc. The body itself can
be plain old Arial or whatever. Is there an HTML Tag to stick the
signature in there? I am NOT an HTML programmer so that is not my
forte at all.

Thanks for your help.
 
S

Sue Mosher [MVP-Outlook]

The signature is part of the item body. It is not a separate property. The signature will be present if you display the message (or access its Inspector with GetInspector). You would then modify the HTMLBody property to insert the additional content you want to include. In other words, you will need to know HTML to make this work.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Yes, that's possible. You'd need to instantiate an Outlook.Application object, then use its CreateItem() method to create your message. Add formating by setting the value of the HTMLBody property to the fully tagged HTML content that you want the message to display.
- Show quoted text -

I am creating the emails using those objects/methods. I did see the
htmlbody property/setting and set that but the email I send doesn't
have the default signature from outlook on it. That is more
important than using fonts and stuff actually. Is there a way to add
the signature section to the outgoing email? I didn't see a property/
setting/method in the object definition that let me do that.

I really just want the email to look like they sent it natively from
their outlook session with their signature etc. The body itself can
be plain old Arial or whatever. Is there an HTML Tag to stick the
signature in there? I am NOT an HTML programmer so that is not my
forte at all.

Thanks for your help.
 

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