Aspose.Slides.HasMacros

Hello

I want to convert all pps, ppt and pot files to new formats (ppsm, ppsx, pptm, pptx, potm, potx).
How I can check a slide whether it has macros?

In Aspose.Words and Aspose.Cells is a method called “HasMacros”, is there a similar function for Aspose.Slides?

I’m using Aspose.Slides V15.8.0.0

Thanks and regrads
Mario

Hi Mario,


Thank you for your interest in Aspose.Slides.

I have observed your comments and like to share with you that Macros are present on presentation level and you can check if macros are present or not as in the code below.

Presentation pres = new Presentation(@“D:\test.pptx”);
if (pres.VbaProject != null)
{
//ToDo code here
}

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

Hi Muhammad

Thank you very much, your solution worked perfectly! :slight_smile:

Regards
Mario

just one more question…
Your solution worked, but when I try to open a converted pot file (now potx), PowerPoint notify that the file is corrupt and must be repaired. After reparing, I’m missing some content.
Do you have a solution for that?

Thanks & regards
Mario

Hi Mario,


We are glad to know that things have started working on your end.

I have observed your comments and like to request you to please make a separate post for the issue you are facing on your end. Write down all the details, attach the source file and generated output file as well as the sample code which is causing the problem so that we may investigate it further to help you out.

Best Regards,