2
Outlook.Inspector = Globals.ThisAddIn.Application.ActiveInspector();
Word.Document document = (Word.Document)inspector.WordEditor;

//I have some code that determines start and end of the range i want to highlight.
//lets say they are:
object start = 0;
object end = 5;

Word.Range rng = document.Range(ref start, ref end);

//I have tried this but it didn't work but it throws an exception that Highlight 
//section is disabled or something like that.
rng.HighlightColorIndex  = WdColorIndex.wdYellow;

我还尝试从范围中获取文本并使用 Word.Find 对象并在此文本上使用 Find.HitHighlight 方法,但问题是它突出显示了超出指定范围的文本外观。

任何帮助将不胜感激!

4

0 回答 0