FindReplaceOptions.IgnoreStructuredDocumentTags
FindReplaceOptions IgnoreStructuredDocumentTags property. Gets or sets a boolean value indicating either to ignore content of SDT. The default value is false.
FindReplaceOptions.IgnoreStructuredDocumentTags property
Gets or sets a boolean value indicating either to ignore content of SDT. The default value is false
.
public bool IgnoreStructuredDocumentTags { get; set; }
Remarks
When this option is set to true
, the content of SDT will be treated as a simple text.
Otherwise, SDT will be processed as standalone Story and replacing pattern will be searched separately for each SDT, so that if pattern crosses a SDT, then replacement will not be performed for such pattern.
Examples
Shows how to configure find/replace options to ignore matches in particular document elements.
ReplacerContext context = new ReplacerContext();
context.SetReplacement("findme", "Replacement Text");
context.FindReplaceOptions.IgnoreDeleted = true;
context.FindReplaceOptions.IgnoreFieldCodes = true;
context.FindReplaceOptions.IgnoreFields = true;
context.FindReplaceOptions.IgnoreFootnotes = true;
context.FindReplaceOptions.IgnoreInserted = true;
context.FindReplaceOptions.IgnoreShapes = true;
context.FindReplaceOptions.IgnoreStructuredDocumentTags = true;
Replacer.Create(context)
.From(MyDir + "Replacing.docx")
.To(ArtifactsDir + "Replacer.FindReplaceOptionsIgnore.docx")
.Execute();
See Also
- class FindReplaceOptions
- namespace Wordize.Replacing
- assembly Wordize