Stephen Lebans's ExtractInventoryOLE

G

Guest

I am using Stephan’s latest code to extract OLE field (containing Photos) to
disk. In the function ‘fGetContentsStream’ in module ‘modGetContentsStream’,
the code returns false if it finds out the ole is a linked object. In the
same module, there is another function ‘fInventory’, which extracts the
original full file path from the ole header. I am using these two functions
to extract a 200G OLE database to disk, one for embedded object and the other
for linked object. The problem occurs when the OLE field is a linked object
and the extracted file path is no longer valid, which means the original
linked file has been moved or no longer exists on the disk. But from the
access front-end, I can still view the photo in the form, even though I
cannot edit the photo (if it is a valid file path, I can edit the photo).
And the datalength of the linked ole object is even bigger than the embedded
one. So in theory the photo is somehow saved in the ole field. My question
is: is there a way to extract the original content of the photo from the
linked ole object, for example, modifying the function ‘fGetContentsStream’,
which changes the size of the header or the offset of the real content.
I am stuck here. Help!!! I expect that Stephen can sort this out, I hope he
reads this and can help.
 
S

Stephen Lebans

What you are seeing is the embedded Bitmap or WMF OLE Preview. It may or may
not be(usually is) an exact copy of the originally inserted Image. I need to
add an option to allow the user to save this to disk as the only available
representation of the inersted image.

In the meantime, you can use one of the older, Preview based Image
extractors on the same Web page as OleToDisk. Just scroll down the page a
bit.

Let me know how you make out.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
G

Guest

Hi Stephen,

Thank you very much for your reply.
Is ‘SavePictureDataBitmap’ the one that you mentioned as Preview based Image
Extractors? But unfortunately, the OLE data of my company’s database is
saved as ‘Paint Shop Pro 7 Image’ rather than Bitmap Image. So I could not
use the BitmapHeader in the code. I also tried another package on your
website which is called ‘SaveOLEtoBitmapAuto.zip’, but without success. I
assume it cannot deal with Paint Shop Pro either. Is there a way to extract
the paint shop pro’s header? Can I reuse the code for the embedded object
that supports "PSP7.Im"?

Cheers,
Lily Jin
 
S

Stephen Lebans

Lily you have me confused. I thought you stated that that my OLE Extraction
tool worked find except for "linked" OLE images. You could still view a
representation of the original linked Images when you viewed the records in
Form view using a bound OLE Frame control. I pointed you to the older
SaveOLEtoBitmap solutions on the same Web page. They actually use the
Clipboard to force the OLE Frame control to save a copy of itself to the
Clipboard. In other words, it will work for any OLE image that you can view
on an Access form, regardless if whether the image is linked or embedded.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

Hi Stephen,

Sorry about the confusion. Yes, my problem is only about the linked ole
image. What I really tried to say is that: after I exported some data to the
table in your SaveOLEtoBitmap solution, the ole field in the table shows
‘Paint Shop Pro 7 Image’ rather than Bitmap. But I guess this does not matter
as the solution copies the content of the ole control to the clipboard.
Unfortunately, I still have problem dealing with this. The code always throws
a ‘run out of memory’ error, even though the images in the database are about
4MB each (Sometimes GetClipBoard returns -1, sometimes SavePicture throws an
out of memory exception if GetClipBoard returns valid value.) I tried to
empty the clipboard in different places of the code, but the problem still
exists.

Cheers,
Lily
 
G

Guest

Hi Stephen,

To be more precise about the exception in the code, GetClipboardData() from
Lib “user32†always returns 0 if it comes to my ole image data, although it
does return valid value for ole image you originally stored in the table.

Hope you can help me sort this out!

Cheers,
Lily
 
S

Stephen Lebans

Lily can you Email an MDB containing ONLY one or two of the images?
(e-mail address removed)


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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