OLE Query (1 Viewer)

shiznaw

Registered User.
Local time
Today, 08:32
Joined
Feb 3, 2016
Messages
18
I'd thought I give you an update on where I'm at. These are the rules I discovered for extracting a PDF from an OLE BLOB..

  1. Delete from beginning of the BLOB to the string %PDF
  2. Delete from the string EOF%% 0xOD 0xOA to the end of the BLOB

    Edit: This was being put in by the code I was using to write the BLOB to file
  3. Delete all occurrences of the sequences of 0x11 0x20 0x01 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x00 in the BLOB

I've found two places on line with some code (not VBA) with claims that it extracts a PDF. Neither of them implement rule 3. But if you leave them in, Acrobat Reader will tell you the resulting file is damaged and won't open it.

Tomorrow I'll try to implement these rules in VBA which I definitely going to be a learning experience for me. I'm finding that none of the string functions I normally count on will help me manipulate the BLOB chunks.

I need to ask just how you found this out. What was your process for eventually determining that VBA was adding this programmatically? How did you find this out?
 

sneuberg

AWF VIP
Local time
Today, 08:32
Joined
Oct 17, 2014
Messages
3,506
I need to ask just how you found this out. What was your process for eventually determining that VBA was adding this programmatically? How did you find this out?
If you mean those sequences ( 0x11 0x20 0x01 0x00 0x00 ...) I was finding I outputted the entire BLOB at once rather than in blocks as was being done by the code I was using and they disappeared from the output. See https://support.microsoft.com/en-us/kb/103257 for the code that was messing me up.

If you mean the starting sequence %PDF and the ending sequence %%EOF they have nothing to do with VBA. They are at the beginning and end of PDF documents before they become a OLE Object. There were various WEB sites that pointed this out.
 

Users who are viewing this thread

Top Bottom