user2104560
user2104560

Reputation:

How underline text in MS Word with wavy red lines?

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

Answers (2)

Valdes
Valdes

Reputation: 11

using Word = Microsoft.Office.Interop.Word;

To color underline the word, you should use: targetWord.Font.ColorIndex = Word.WdColorIndex.wdRed;

Upvotes: 0

Raptor
Raptor

Reputation: 54222

To underline the word, use:

targetWord.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineSingle;

Reference: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.range.underline(v=office.11).aspx

Upvotes: 1

Related Questions