DeleteShapes
Story.DeleteShapes method
Deletes all shapes from the text of this story.
public void DeleteShapes()
Examples
Shows how to remove all shapes from a node.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Use a DocumentBuilder to insert a shape. This is an inline shape,
// which has a parent Paragraph, which is a child node of the first section's Body.
builder.InsertShape(ShapeType.Cube, 100.0, 100.0);
Assert.That(doc.GetChildNodes(NodeType.Shape, true).Count, Is.EqualTo(1));
// We can delete all shapes from the child paragraphs of this Body.
Assert.That(doc.FirstSection.Body.StoryType, Is.EqualTo(StoryType.MainText));
doc.FirstSection.Body.DeleteShapes();
Assert.That(doc.GetChildNodes(NodeType.Shape, true).Count, Is.EqualTo(0));
See Also
- class Story
- namespace Aspose.Words
- assembly Aspose.Words