Mehmet Fatih

Mehmet Fatih

  • 831
  • 930
  • 37.7k

Changing text color in word atomation

Feb 16 2024 9:17 AM

I want to make the text color of the x sign red. I have tried this oWord.Selection.Font.ColorIndex = Word.WdColorIndex.wdRed; but it didn't work.

 if (fieldName == "K")
 {
     myMergeField.Select();
     oWord.Selection.TypeText("X");   // I want to make the x sign red

     oWord.Selection.Font.ColorIndex = Word.WdColorIndex.wdRed;
 } 


Answers (3)