Embedded objects in Word

V

VBDevDoug

I've got a set of Word documents that have embedded Outlook emails. Some of these embedded objects have attachments. What I need to be able to do is automatically save these Outlook attachments as separate files for later processing. Is this possible? I'm using Visual Basic to automate Word, and I can get the attachment as an inlineshape (the classtype is "Outlook.FileAttach") but there doesn't seem to be a way to save the file. Word is able to open the file, but I haven't found a way to then send a command to save it.
 
W

Word Heretic

G'day VBDevDoug <[email protected]>,

It's tres tricky, you just follow the way the computer does it.

All non-RTF embedded objects are, content wise, rendered pictures. You
use the OLE verbs on the shapes of the correct type.

If you then pause with an OnTime, you can then examine the now-open
objects from their new host.

I am no Outlook guru, but I am sure the messages have attachments.
Your part2 macro, called from OnTime, needs to find the Outlook Task.
Make a reference from your VBProject to the Outlook lib so you can use
their objects. From there, you dive into each instance of a message
(you may want to check prior to entering outlook what existing
messages there are already so you can ignore them) and save the
attachment under a given name to a tmp dir.

If the files are zipped, Shell a zip command to unzip them on the
spot.

Now you can use Dir to pick up the saved files and insert them into
the correct ranges. Tracking objects to make sure you get the right
range will surely be fun fun fun. Enjoy your Static Variables is all
I'll say :)

Del the tmp dir and you're done.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


VBDevDoug reckoned:
 

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