Mokh Akh
Mokh Akh

Reputation: 431

how to add many colors to single paragraph

i try to make multi color in same line list but i get a wrong result

i need to make something like the below image :

enter image description here

my current code :

paragraph = range.Paragraphs.Add();
paragraph.Range.Text = "Test";
paragraph.Range.Font.Color = Word.WdColor.wdColorSkyBlue;

paragraph = range.Paragraphs.Add();
paragraph.Range.Text = "Word";
paragraph.Range.Font.Color = Word.WdColor.wdColorRed;

paragraph = range.Paragraphs.Add();
paragraph.Range.Text = "Color";
paragraph.Range.Font.Color = Word.WdColor.wdColorBrown;

the result show 3 lines

Upvotes: 0

Views: 42

Answers (1)

Alox
Alox

Reputation: 671

Since I need 50 rep to comment, I'll mark it as an answer. From what I am reading, you should make a Sentence class and when you're done the sentence add it into your paragraph.

Upvotes: 1

Related Questions