Removing OLE objects in xls / ppt / doc

From my evaluation, I am able to remove OLE objects for excel file using these codes:

            WorksheetCollection all_worksheets = excel.Worksheets;
            foreach (Worksheet worksheet in all_worksheets)
            {
                worksheet.OleObjects.Clear();
            }

But I do not seem able to find similar API for doc / ppt, can the same be done for doc / ppt ?

Regards
Tse Erh

@tse.erh,

Thanks for contacting support.

When using Aspose.Slides, please note that OLE Objects are derived from Shapes class and are of type Shapes. They can be removed from slide shape collection. For more information, please visit ShapeCollection.Remove method and ShapeCollection.RemoveAt method.

Now concerning to Word files, please try using Node.Remove method in Aspose.Words for .NET

[C#]

NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
// Loop through all shapes
foreach (Aspose.Words.Drawing.Shape shape in shapes)
  {
        if (shape.OleFormat != null)
           {
            shape.Remove();
           }
  }

Thanks for the help !