Reputation:
I'm interested in MS Word document formatting. I'm developing addin on C# and want to know how draw wavy red line under some word programmatically?
Current code:
Word.Range targetWord;
targetWord.Font.Color = wdColor.wdColorRed;
where targetWord
is a Range
object
Upvotes: 2
Views: 3819
Reputation: 11
using Word = Microsoft.Office.Interop.Word;
To color underline the word, you should use: targetWord.Font.ColorIndex = Word.WdColorIndex.wdRed;
Upvotes: 0
Reputation: 54222
To underline the word, use:
targetWord.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineSingle;
Upvotes: 1