0
我想使用VSTO突出显示Microsoft Word 2010中给定字符串的所有出现。使用VSTO突出显示在Word中出现的所有字符串
到目前为止,我已经成功地设置前景色为使用Find
设施的匹配:
Word.Find find = Application.ActiveDocument.Content.Find;
find.Replacement.Font.ColorIndexBi = Word.WdColorIndex.wdYellow;
find.Execute(FindText: "dog", MatchCase: false, Replace: Word.WdReplace.wdReplaceAll);
不过,我想设定高的比赛,如下面的截图:
记录在VBA建议您设定高通过将Application.Options.DefaultHighlightColorIndex设置为其中一个wdColorIndex成员(例如wdYellow),并使用find.Replacement.Highlight = True在Replace中应用突出显示颜色。这些通过VSTO可用吗? – 2014-01-11 16:17:32
@bibadia:谢谢,那工作:-)如果您将您的评论复制到答案,我会接受它。 – Douglas
谢谢,完成 - 我通常会发现检查VBA端更快,但不希望发布答案,除非我确定通过PIA等提供相同的选项。 – 2014-01-11 16:42:21