Embedded PPT Is Converted to Image after Updating OLE Object in C#

@tamas.boldizsar

It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-22331) as ‘Not a Bug’.

Aspose.Slides changes the structure of the PPT document with incorrect ProgID. When Aspose.Words inserts the modified file with ProgId ‘PowerPoint.Slide.8’ , we get the correct result.

We are moving this forum thread to Aspose.Slides forum. Our Aspose.Slides team will investigate and log your issue.

@tahir.manzoor

Understood. Thank you very much for the earlier and further investigation!

@tamas.boldizsar,
It will take me a while to investigate this case. I will answer you later. Thank you for your patience.

@Andrey_Potapov

Thank you for your help! I am looking forward to hearing from you.

@tamas.boldizsar,
I reproduced the problem and logged the issue with ID SLIDESNET-42666 in our tracking system. Our development team will investigate this case. You will be notified when it is fixed.

1 Like

@Andrey_Potapov

I am very grateful, thank you!

@tamas.boldizsar,
Our development team investigated the issue and code examples you provided. Aspose.Slides has PptOptions.RootDirectoryClsid property that enables custom identifier for COM activation. In your case, the method ProcessSlideEmbeddedObject needs to be modified like this:

private void ProcessSlideEmbeddedObject(Aspose.Words.Drawing.Shape shape, string embeddedFileExtension)
{
    using( var objectStream = SaveObjectToStream(shape.OleFormat))
    using (var slidesDoc = new Aspose.Slides.Presentation(objectStream))
    {
        var textFrames = Aspose.Slides.Util.SlideUtil.GetAllTextBoxes(slidesDoc.Slides[0]);
        textFrames[0].Text = "MODIFIED TEXTFRAME";

        var modifiedObjectStream = new MemoryStream();
        if (embeddedFileExtension.Equals(".ppt"))
        {
            slidesDoc.Save(modifiedObjectStream, Aspose.Slides.Export.SaveFormat.Ppt, new PptOptions
            {
                RootDirectoryClsid = new Guid("64818d10-4f9b-11cf-86ea-00aa00b929e8")
            });
        }
        else
        {
            slidesDoc.Save(modifiedObjectStream, Aspose.Slides.Export.SaveFormat.Pptx);
        }

        UpdateObjectData(modifiedObjectStream, shape);
    }
}

Please pay attention to the next part:

if (embeddedFileExtension.Equals(".ppt"))
{
    slidesDoc.Save(modifiedObjectStream, Aspose.Slides.Export.SaveFormat.Ppt, new PptOptions
    {
        RootDirectoryClsid = new Guid("64818d10-4f9b-11cf-86ea-00aa00b929e8")
    });
}

This is where the required CLSID to ‘Microsoft Powerpoint.Show.8’ was set.

@Andrey_Potapov

I have just tried what you suggested and it solved my problem. It was a great help, thank you very much!