Linked OLE Objects

G

George

Hi,

I'm having two problems with linking/embedding OLE objects.

The first problem. When I use "Insert|Object...|Create from File" and browse
to a file (say WAV file) then select the file and check "Link to file" I get
an embedded object instead of a linked one; I can't see the object under
"Edit|Links..." and I get the same result whether I check/uncheck the "Link
to File". Also when I iterate through the InlineShapes I see the object is
of Type "wdInlineShapeEmbeddedOLEObject" where it should be
"wdInlineShapeLinkedOLEObject". I loose the link to the original file this
way and can't get a reference to it. The only files I get them linked are
the graphics files and office documents. Any idea why does this happen and
how to link the files instead of embedding them?

The second problem. I want to save each of these embedded objects to a
separate file. If they were linked, then there is no problem since I can get
a reference to the original file. But when they are embedded and I iterate
through the InlineShapes collection I get only an "OLEFormat.ClassType" =
"Package". I tried OLEFormat.object but I get a "No such interface
supported" error, and couldn't find any other property to tell me anything
about the original object. How can I know the exact type of the embedded
file and how can I save the object to an external file?

Thanks,
George
 
R

Robin Tucker

I'm not sure about your first point, but on the second, if your OLE object
supports the IPersistStorage interface, then you can save it directly to
disk from the OLEFormat.Object reference. This of course depends on whether
the IPersistStorage interface is available to you (I had to write a wrapper
for it in VB.NET).
 

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