Extract path from OLE files

M

Matt Williamson

I have many word docs that are OLE links in Outlook and I need to extract
the path and filename. Outlook itself is very sparse in its handling of
olOLE type attachments, but I've found that I can save them to disk. When I
look at the file using Ultraedit, it comes up in hex. I can clearly see the
path I want to extract in plain ascii text at the bottom of the file, but it
isn't at the same offset in each file and it looks like there is a unicode
version of the same string in the file as well. My initial attempt at
extracting it was to read the whole file into a string buffer, find the
offsets for the starting "\\" and ending ".doc" and pulling it out that way,
but since it's in there multiple times, that didn't work so well. I'm just
trying to get an idea of what would be the best way to extract that string.
Is there a definition file for this type of OLE object? I know I've only
mentioned Outlook, but I'm doing this in VB6 using the Outlook Object model.

TIA

Matt
 
D

Dmitry Streblechenko

You won't have much luck - OLE attachments are stored in an IStorage object.
What exactly is there, is up to the host app (Word in your case), Outlook
has no idea what is in there.
Look at an OLE storage with DocFile Viewer (or with OutookSpy) to see fi
there is any stream in that storage taht you can easily parse.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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