We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Slides Support

Hi, In my requirement, I need to use Aspose Slide library to identify whether PPT has macros and objects embedded. If any files attached, I need to list out all file type attached. Please provide me sample code to know whether it has Macros and objects embedded.

Hi Ganesh,


I have observed the requirements shared by you and like to share that you can identify any VBA project or embedded objects in presentation. I like to share that VBA project are defined on presentation level so you can access them on presentation level. You can use the following sample code to get the VBA project.

Presentaiton pres=new Presentation(“Test.ppt”);
if(pres.VbaProject !=null)
{

}

The embedded objects are Ole frames added on slides as normal shapes. You need to access the particular slides shapes collection that has embedded object on it and access that for your convenience. Please visit this documentation link to serve the purpose on your end.

Many Thanks,

As per your documentation, I have written code to identify whether the PPT has embedded objects. Please see attached my code in this forum. I am getting error as “Unable to cast object of type ‘Aspose.Slides.AutoShape’ to type ‘Aspose.Slides.OleObjectFrame’.”

Please help me what is wrong in my code.

Hi Ganesh,

I have observed the code sample shared by you and like to share that the slide contains the shapes of many types and from which IOleObjectFrame is one of that. So, you need to check if the shape is an OleObjectFrame or not before type casting shape object to OleObjectFrame. Please try using the following modified sample code to serve the purpose on your end.

public static bool HasEmbeddedObjects(Stream stream)
{
Presentation pres = new Presentation(stream);
bool hasObject = false;

foreach (var slide in pres.Slides)
{
foreach (var shape in slide.Shapes)
{
if(shape is IOleObjectFrame )
{
IOleObjectFrame oof = (IOleObjectFrame)shape;
if (oof != null)
{
hasObject = true;
}
else
{
hasObject = false;
}
}
}

}
return hasObject;
}

Many Thanks,

Thank you so much. Its working. I have done all my research with Aspose library. It is covering all of our requirements. My organization is working on to buy this product. My organization interested to know below requirements\limitations:

  1. What is the hardware requirement to use Aspose
  2. Criteria to be considered to process high volume and document size to decide on how many servers required for processing.
    3)Any limitation in processing Microsoft documents
    Please reply as soon as possible.

Hi Ganesh,


Thank you for your growing interest in Aspose.Slides.

I have observed the requirements shared by you and request you to please consult our sales team in Aspose.Purchase forum for these requirements. They will assist you further in this regard once you will share all of your requirements.

Many Thanks,