VSTO Word 2016: Squiggly underline without affecting undo : <p>I am working on a real-time language analysis tool that needs to highlight words to draw attention from the writer in Word 2016 using a VSTO add-in, written in .NET4.6.1 with C#. Think of the grammar/spelling check, which adds a squiggly line underneath a word to show you that the word has grammatical or spelling errors. I'm adding a similar feature for some of my own defined rules. </p>

<p>I searched around on adding squiggly lines, and stumbled on <code>Font.Underline</code> and <code>Font.UnderlineColor</code>. I set this on the range of a word, and it appears to provided that visual stumili I was after to draw attention. There is a problem, though. Every underline I add or underline color I change adds an undo action to the undo stack.</p>

<p>I don't want this to happen, or I want a way to pop the action I just did in code from the stack. The aim is to have the user be able to use CTRL+Z to remove <em>text</em> he changed, and not affect my language anlysis result.</p>

<p>How would I go about doing this?</p>
