Insert an image in a new email

W

Wolfgang Kais

Dear newsgroup.

I am trying to insert a picture into a new email using vba code in Outlook
2003. The attachments.add method seems to add an attachment (or an icon),
but what I want is to automate the functionality of the menu command "Insert
Picture" that will display the picture inline. How can this be done using
VBA?

Thanks in advance,
Wolfgang
 
K

Ken Slovak - [MVP - Outlook]

You can find the ID of that button in the menus and call its Execute method,
that will open that dialog but not automate it further. Other than that
you'd have to create your own replica dialog.

You can automate inserting an attachment as an embedded object if you want,
or attach it using code in any of the other supported ways but that's about
it.
 
S

Sue Mosher [MVP-Outlook]

Just to add to what Ken says, if Word is the email editor, you have an additional option: Return a Word.Document object using the Inspector.WordEditor method, then use Word methods to insert a picture. In this instance, the Word macro recorder can be your friend.
 
W

Wolfgang Kais

Thank you, Ken.

I'd like to know what you mean by "my own replica dialog".
I have no problem in creating a dialog form, neither in Word nor in
Outlook, the problem is the code to create the inline picture knowing the
path to the file.
 
W

Wolfgang Kais

Thanks to both of you.

I agree that it was all simple if the users selected Word as their email
editor, but I can't predict that.
I found the following: http://www.outlookcode.com/d/code/htmlimg.htm
That seems a little complicated, but maybe I'll give it a try.

Thanks again!
--
Regards,
Wolfgang

in "quoted printable":
Just to add to what Ken says, if Word is the email editor, you have an
additional option: Return a Word.Document object using the
Inspector.WordEditor method, then use Word methods to insert a picture. In
this instance, the Word macro recorder can be your friend.
 
K

Ken Slovak - [MVP - Outlook]

What I meant was to design and use your own form instead of the Outlook
form. That's the only way you'd have control over the dialog and would know
for example what image was selected.
 

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