IgnoreShapes
FindReplaceOptions.IgnoreShapes property
获取或设置一个布尔值,指示忽略文本中的形状。
默认值为错误的
。
public bool IgnoreShapes { get; set; }
例子
演示如何在替换文本时忽略形状。
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
builder.InsertShape(ShapeType.Balloon, 200, 200);
builder.Write("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
builder.Document.Range.Replace("Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.", new FindReplaceOptions() { IgnoreShapes = true });
Assert.AreEqual("Lorem ipsum dolor sit amet, consectetur adipiscing elit.", builder.Document.GetText().Trim());
也可以看看
- class FindReplaceOptions
- 命名空间 Aspose.Words.Replacing
- 部件 Aspose.Words