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方法,但问题是它突出显示超出指定范围的文本外观。
任何帮助将受到高度赞赏!