Form code to create "new message using stationery"

P

Peter J. Veger

I am using Outlook 2003 (but will change to Outlook 2007 within a few
weeks).

It is simple to create a new message, e.g. by
Set myMessage = Application.CreateItem(0)

Is it also possible to create a new message that uses specific stationery
(emulating in VBscript the action "New Mail Message using...")
 
P

Peter J. Veger

Maybe my question was not clear enough, so I will give some context.
I am a member of a sailing club with 300 members.
When a board member wants to send an e-mail to all members, I start a menu
item on the menu Actions with the name 'club distribution'. I then get a
form with a few controls (esp. a body control) and VBscript code. The
information to distribute is put into this body control. After pushing a
button 'send message', the VBscript code creates a mail item with as
BCC-field the list of member e-mail adresses from an Access database, the
body of the mail item is constructed from the submitted info plus a few
texts explaining the way of message sending.
We now want to embellish the message: the generated body of the mail item
should contain a top banner with the club logo and a bottom banner.
So the problem is: is the possible to generate the mail item from stationery
and to put the info the two banners?
 
S

Sue Mosher [MVP-Outlook]

Yes, that's possible, and Eric's sample shows you one method -- by reading the .htm file that holds the stationery. You would then need to insert your content into the HTMLBody of the message that has the stationery content.

Also see http://www.outlookcode.com/d/code/htmlimg.htm if you just want to insert the images directly using the code you already have.

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


Peter J. Veger said:
Maybe my question was not clear enough, so I will give some context.
I am a member of a sailing club with 300 members.
When a board member wants to send an e-mail to all members, I start a menu
item on the menu Actions with the name 'club distribution'. I then get a
form with a few controls (esp. a body control) and VBscript code. The
information to distribute is put into this body control. After pushing a
button 'send message', the VBscript code creates a mail item with as
BCC-field the list of member e-mail adresses from an Access database, the
body of the mail item is constructed from the submitted info plus a few
texts explaining the way of message sending.
We now want to embellish the message: the generated body of the mail item
should contain a top banner with the club logo and a bottom banner.
So the problem is: is the possible to generate the mail item from stationery
and to put the info the two banners?

--
Peter J. Veger, Best Netherlands


See http://blogs.officezealot.com/legault/archive/2005/07/21/7581.aspx
 

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