Hi Ganesh,
Presentaiton pres=new Presentation(“Test.ppt”);if(pres.VbaProject !=null){}
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:
- What is the hardware requirement to use Aspose
- 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,