Hello Ludwig,
Here's the scenario: I embedd a .txt file in Word as OLE object,
then I copy it (manually), so now it's on the clipboard. How do I
programaticall y (in C#) get that OLE object file from the clipboard
and dump it into an actual text file on the file system? All I would
like to know is how to grab the OLE from the clipboard and transform
it into a file, stream, string, or anything that gives me the internal
contents of that txt file.
I think you'll have to use the OLE interfaces to do this - IDataObject
seems to come to mind. With this type of content, the statement "[the file
is] now on the clipboard" is not correct, as the clipboard only contains
information about the file, not the file itself. To get to the actual
content in a certain representation, you have to communication with the
application that's the source of the clipboard operation, and to do that
you have to use the OLE interfaces.
I'm not aware of any existing .NET code to help you, but you may well find
some on sites like CodeProject. Otherwise dig out a copy of Inside OLE 2
and hack away... <g>
Oliver Sturm
--
http://www.sturmnet.org/blog