Working with Word for WPF > Basic Level Working > Adding Text |
You can add text to a word document using C1Word. You need to write the desired text and use AddParagraph method to add text. You can also set other properties, such as font style, family, color, and more for the text to be displayed in the word document using Font class and its properties. The implementation of adding text to a word document is given in the code below:
Dim text = "Hello!! This is a sample text." Dim font = New Font("Segoe UI Light", 20, RtfFontStyle.Italic) word.AddParagraph(text, font, Colors.BlueViolet, RtfHorizontalAlignment.Justify)
var text = "Hello!! This is a sample text."; var font = new Font("Segoe UI Light", 20, RtfFontStyle.Italic); word.AddParagraph(text, font, Colors.BlueViolet, RtfHorizontalAlignment.Justify);
The document will look similar to the image below: