ReplacementFormat Enum

Wordize.Replacing.ReplacementFormat enum. Specifies the replacement format.

ReplacementFormat enumeration

Specifies the replacement format.

public enum ReplacementFormat

Values

NameValueDescription
Text0Replacement is treated as simple text.
Markdown1Replacement is interpreted as Markdown text.
Html2Replacement is interpreted as Html formatted string.

Examples

Shows how to replace text in the document using regular expression pattern with MD formatted text.

FindReplaceOptions options = new FindReplaceOptions();
            options.ReplacementFormat = ReplacementFormat.Markdown;

#if PYNET
            string pattern = @"[a-zA-Z]{6}\d+";
#else
            Regex pattern = new Regex(@"[a-zA-Z]{6}\d+");
#endif

            string mdReplacement = "**This** *Is* `Replacement`";
#if PYNET
            int replacements = Replacer.ReplaceRegex(MyDir + "Replacing.docx",
                ArtifactsDir + "Replacer.Replace4.docx",
                SaveFormat.Docx,
                pattern,
                mdReplacement,
                options);
#else
            int replacements = Replacer.Replace(MyDir + "Replacing.docx",
                ArtifactsDir + "Replacer.Replace4.docx",
                SaveFormat.Docx,
                pattern,
                mdReplacement,
                options);
#endif

See Also