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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook 2007 Macro (VB Coding)

Status
Not open for further replies.

rekrabnai

Technical User
Sep 28, 2000
32
GB
Hi, Am new to the world of Outlook 2007 (and its macros).

Please could someone help!!!

I autogenerate and email from an Access 2007 DB. All is fine except that the email contains TEXT only.I would like to create a macro in Outlook 2007 to insert a picture into the Email content.

The Picture path is c:\temp\piccy1.bmp (for example).

I can create a macro, but have no idea what VB to put in it!!

Many thanks in advance for your advice/help

 
hi,

"I can create a macro, but have no idea what VB to put in it!!"

alt+F11

or

Tool > Macro > Visual Basic Editor

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi SkipVought

Thanks for the quick reply. I obviously didnt explain it too well... it's the VB code snippet that I am after for inserting a picture into the Email itself.

Thankyou anyway for the response.

Ian
 
Do you have ANY code so far?

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
In order to insert a pic, you need to create the mail as an HTML-Mail and link the pic in the respective Body section, or create an Richtext mail and embedd it.
Both can be done by not creating a mail and manipulating that, but by first creating an HTML or RTF document, and then:
Code:
dim ol as Outlook.Application, MI as Outlook.MailItem
'...
'...
Set MI=ol.CreateItemFromTemplate("[full path to your newly created doc]")
With MI
   .To=blabla@yaketyak.com
'...
   .send
End With

Would that do it?
;-)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 




Code:
   .To=blabla@yaketyak.dont.com.bak
[blush] I couldn't help myself!!!!

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Job Done.... Many thanks.... thankyou people... just what the doctor ordered.... I love this site!

Regards

Ian
 
Code:
   .To=blabla@yaketyak.dont.com.bak
[blush] I couldn't help myself!!!!
LOL!
Alas, the correct domain would then be yaketyak.dont.talk.bak

:p

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 

poetic licence: a come back is to talk back.
a [tt]STrrreeeeeeetttttCH[/tt]

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top