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

Copy / Paste Picture From Word Into Email?

Status
Not open for further replies.

GarstonMassive

Programmer
May 5, 2006
71
GB
Is this possible in code and if so how do you do it?

I can get the text no problem; pictures are a different kettle of fish.
 
Hmm, my guess would be some code that would find the particular object of the picture in the Word document, and copy and paste that. Not sure right off hand, but I would think the Word VBA help file might give you enough info on that, if you search for something like "picture object".
 
Thanks for your reply KJV.

Just a little more background - I'm trying to copy the contents of a Word doc and paste it into an email, from within an Access procedure.

I'll take a look at the Help file.
 
Hmm, if you are wanting to send the entire contents of a Word doc in an email message via Outlook, why not just send it? I've not tried this specific method, but I'm sure you can just invoke the "Send to mail recipient" feature in Word. Is that more what you are trying to do rather than just a copy and paste?
 
No I'm working within a database and they want to be able to choose a doco that they've written before and then have this text displayed in the body of an email (also includes pictures) all at a click of a button.

I can insert the picture using HTML but then the rest of the doco (text) comes out unformatted.

Pulling my hair out here!
 
That's why I was thinking of the "File-SendTo-MailRecipient"... You could have it open Word, and choose that option, which will send the Word text and pictures exactly as in the Word document within an email message (in the body part of the message), so then you would only need to specify the To: and Subject fields.
 
...could I automate this so that I could do the following:

1) Open Word
2) Select "File-SendTo-MailRecipient" (from code)

or would the user have to do any of this manually?
 
Well, I don't see why you couldn't automate it this way:

Open Word once, and choose:
Tools menu
-->Macro
---->Record New Macro

Give the macro a name, tell it to be stored in "All Documents (Normal.dot)", and hit OK.

Then do your File -> Send To -> Mail Recipient

Stop the recording.

Then, look at it in the vba code, and see if you need to do any customization.

If you are wanting to be able to run the code from Access, I believe you'll need to enable the Word Reference under Tools ->References in the Access VBA window, and of course, open whatever Word file you are wanting to open each time, and do all of that. You should be able to open the file without actually showing it on the screen, as well.
 
In the interests of consistency and by way of follow-up please see the link to a thread of mine of a similar nature:

thread705-1288963
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top