J
jcody
I would like to find a way to programmatically save embedded OLE objects
into a file folder from a Word document.
I have many Word documents that have many emails (and other files) embedded
within them, and I need to find a way to "extract" these embedded documents
and save them as files quickly.
One approach I've tried uses the Word object model to loop through the
InLineShapes collection. I can see that each of the embedded OLE objects
are in the collection.
// *** Begin: Sample Code ****************
using Microsoft.Office.Interop.Word;
foreach (InlineShape inlineShape in document.InlineShapes)
{
if (inlineShape.Type == WdInlineShapeType.wdInlineShapeEmbeddedOLEObject)
{
// Obtain the file name.
Trace.WriteLine("FileName: " +
Path.GetFileName(inlineShape.OLEFormat.IconLabel));
}
}
// *** End: Sample Code ****************
The problem is that I don't want to save the files by activating them.
Is there a way that I can save them directly to a file?
Thank you.
into a file folder from a Word document.
I have many Word documents that have many emails (and other files) embedded
within them, and I need to find a way to "extract" these embedded documents
and save them as files quickly.
One approach I've tried uses the Word object model to loop through the
InLineShapes collection. I can see that each of the embedded OLE objects
are in the collection.
// *** Begin: Sample Code ****************
using Microsoft.Office.Interop.Word;
foreach (InlineShape inlineShape in document.InlineShapes)
{
if (inlineShape.Type == WdInlineShapeType.wdInlineShapeEmbeddedOLEObject)
{
// Obtain the file name.
Trace.WriteLine("FileName: " +
Path.GetFileName(inlineShape.OLEFormat.IconLabel));
}
}
// *** End: Sample Code ****************
The problem is that I don't want to save the files by activating them.
Is there a way that I can save them directly to a file?
Thank you.