ComponentOne Word for WinForms
Working with Word for WinForms / Basic Level Working / Adding Simple Text
In This Topic
    Adding Simple Text
    In This Topic

    You can add simple text to a word document using C1Word. To add simple text, you need to use AddParagraph method and write your desired text in it. You can also set other properties, such as font style, family, color, and more for the text to be displayed in the word document. The implementation of adding a simple text to a word document is given in the code below:

    Use the following code to create an object of C1WordDocument class to use AddParagraph method for adding text:

    Dim C1Word As New C1WordDocument()
    C1WordDocument C1Word = new C1WordDocument();

    Add the following code to add text to word document you want to create:

    Dim font As New Font("Tahoma", 24, FontStyle.Italic)
    C1Word.AddParagraph("Hello World!", font, Color.Blue)
    Font font = new Font("Tahoma", 24, FontStyle.Italic);
    C1Word.AddParagraph("Hello World!", font, Color.Blue);

    The document will look similar to the image below: