HasSmartArt

Shape.HasSmartArt property

返回真的如果这个Shape有一个 SmartArt 对象。

public bool HasSmartArt { get; }

例子

展示如何使用 SmartArt 对象计算文档中形状的数量。

Document doc = new Document(MyDir + "SmartArt.docx");

int numberOfSmartArtShapes = doc.GetChildNodes(NodeType.Shape, true).Cast<Shape>().Count(shape => shape.HasSmartArt);

Assert.AreEqual(2, numberOfSmartArtShapes);

也可以看看