I’ve created a shape in my document.
Using this simple code I expect my output to be a document without that shape.
Using inStream As New MemoryStream(My.Resources.DocumentWithShape) Dim loadDoc As New Aspose.Words.Document(inStream) For Each shape As Aspose.Words.Drawing.Shape In loadDoc.GetChildNodes(Aspose.Words.NodeType.Shape, True) shape.Remove() Next loadDoc.Save "c:\DocumentStillContainsShape.docx") End Using Console.WriteLine("Documents saved") Console.ReadLine()
Yet for some reason the saved document still contains the shape.
When debugging I noticed “loadDoc.GetChildNodes(Aspose.Words.NodeType.Shape, True)” cannot find the shape that is in the document.
Is this a bug or am I doing something wrong?
Thanks in advance!