Word - Embedded Object of type "Package"

B

Bernhard

Hi

I have thousands of work documents with embedded object which I need to
extract.
I am able to extract embedded word or excel but I am having troubles with
embedded Objects of the type "Package".
I am able to determine that an embedded object is a package but I am not
able to determine what that package contains. A package could contain again
another word document or a picture but I could not find any way to
programmatically determine what it contains. Neither was I able to extract
the document or picture it contains.

Does anyone know how to determine the content of a "Package"?
Does anyone know how to extract the content programmatically?

Thanks in advance for your help.


Below is my C# Source which loops over all embedded objects.

My source

object missing = System.Reflection.Missing.Value;
object readonlyobj = false;

_wordApp = new MsWord.ApplicationClass();
_wordApp.Visible = true;

MsWord.Document _wordDocument = _wordApp.Documents.Open(
ref filename, ref missing, ref readonlyobj, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);

foreach (MsWord.InlineShape inlineShape in _wordDocument.InlineShapes)
{
if (inlineShape.Type ==
MsWord.WdInlineShapeType.wdInlineShapeEmbeddedOLEObject)
{
if (inlineShape.OLEFormat != null)
{
MsWord.OLEFormat oleFormat = inlineShape.OLEFormat;
string progID = oleFormat.ProgID;
if (progID != null)
{
if (progID == "Package")
{
// Is an embedded object of the pyte "Package" ->
Microsoft Object-Manager
// -> How to find what is contained in the package?
// -> How to extract it?
}
//oleFormat.Open();
//Field field = inlineShape.Field;
//field.Copy();
}
}
}
 
A

alex.wlm

Im having problems with Microsoft Word i try to copy and paste a photo from
My Pictures, just a simple JPEG and when i paste it into word it shows as a
little icon and when you right click it says its a package object? All i want
is to be able to paste my photos into word, something ive always been able to
do before and i dont understand how or why this has happened?
 

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