private void dgvComments_CellEnter(object sender, DataGridViewCellEventArgs e) { string id = dgvComments[0, e.RowIndex].Value.ToString(); Word.Document doc = Globals.ThisAddIn.Application.ActiveDocument; Word.Find find = doc.Content.Find; find.ClearHitHighlight(); find.HitHighlight(FindText: id, MatchCase: true, HighlightColor: Word.WdColor.wdColorYellow, MatchWholeWord: true); }
private void dgvComments_CellLeave(object sender, DataGridViewCellEventArgs e) { Word.Document doc = Globals.ThisAddIn.Application.ActiveDocument; Word.Find find = doc.Content.Find; find.ClearHitHighlight(); }