Hi,Support:
I want to know whether the api supports multi look-replace operation?
for examle:
if Doc.Range.text.looks(ArrayLookKeys) then
Tip="Doc include the keys=" & ArrayLookKeys(i)
else
Tip="No Hit!"
end if
if so,please tell how to reach it. If not, hope this feature will be considered in future version.
@ducaisoft You can use regular expression to achieve this. For example the following code highlights the words from the lists in the document:
List<string> keyWords = new List<string>
{
"one",
"two",
"three"
};
// Create a regular expression.
Regex regex = new Regex(string.Join("|", keyWords));
Document doc = new Document(@"C:\Temp\in.docx");
FindReplaceOptions opt = new FindReplaceOptions();
opt.UseSubstitutions = true;
opt.ApplyFont.HighlightColor = Color.Yellow;
doc.Range.Replace(regex, "$0", opt);
doc.Save(@"C:\Temp\out.docx");