![]() |
Extract path from OLE files
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 |
Extract path from OLE files
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 "Matt Williamson" wrote in message ... 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 |
All times are GMT +1. The time now is 05:59 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com