Problem in Aspose.Slides OLE Embedded Object

I am using Aspose.Slides to extract an ole embedded object from a powerpoint presentation file. It does not work properly when I have an powerpoint file embedded inside another powerpoint file. It works when a embedded object is a word or an excel.

It actually creates a file for the powerpoint ole object and has all the contents of the object but the file does not get saved with a ppt extension because the OleObjectFrame.ObjectType value is "Unknown" instead of a "PowerPointPresentation".

Please check the sample file attached.

This is my code

Presentation pres = new Presentation(path);

int filenum = 0;

foreach(Slide slide in pres.Slides)

{

foreach (Aspose.Slides.Shape shape in slide.Shapes)

{

filenum += 1;

if (shape.ToString().Contains("OleObjectFrame"))

{

string fileName = @"C:\temp\testAsposeSlides" + filenum + ".";

OleObjectFrame oleOF = shape as OleObjectFrame;

switch (oleOF.ObjectType)

{

case OleObjectType.PowerPointPresentation:

fileName += "ppt";

break;

case OleObjectType.MicrosoftExcel:

fileName += "xls";

break;

case OleObjectType.MicrosoftWordTable:

fileName += "doc";

break;

default:

break;

}

FileStream fstr = new FileStream(fileName, FileMode.Create, FileAccess.Write);

byte[] buf = oleOF.ObjectData;

fstr.Write(buf, 0, buf.Length);

fstr.Flush();

fstr.Close();

}

}

}

Thanks

Dear Sumi,

I have requested development lead to help you in this regard. He will answer you as soon as possible.

Hello Sumi,

It doesn’t really matter what ObjectType it has. In most cases this property used for information only.
The most important property is OleObjectFrame.ObjectProgId.
In you case it has correct value “PowerPoint.Show.8”.

May be OleObjectType has Unknown value because it’s not a PowerPoint Presentation.
It is PowerPoint SlideShow which doesn’t have special type id by MS specification.
And the right extension for this file should be “.pps”.