# Paragraph Styling

Create your own styles to format a paragraph in a Word document using DsWord. Learn more in DsWord docs.

## Content

DsWord allows you to define a style using [Style](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Style.html) class which can be accessed using [Styles](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Run.Style.html) property of the **Run** class. It allows you to apply the defined style to a paragraph using [Style](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Paragraph.Style.html) property of the [Paragraph](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Paragraph.html) class.

## Set Paragraph Style

To set the paragraph style:

1. Define a new style using the **Style** class of type Paragraph using the [StyleType](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.StyleType.html) enumeration and add it to the style collection using [Add](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.StyleCollection.Add.html) method of the [StyleCollection](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.StyleCollection.html) class.
2. Get the character formatting of the paragraph using [Font](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Style.Font.html) property of the Style class.
3. Set the character formatting using the [FontBase](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.FontBase.html) class properties. For example, set the name of the font using the [Name](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.FontBase.Name.html) property and format the font as bold and italics using the [Bold](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.FontBase.Bold.html) and [Italic](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.FontBase.Italic.html) properties respectively.
4. Apply the defined style on the paragraph using **Style** property of the **Paragraph** class.

    ```csharp
    //Add style to the first paragraph
    Style sPara = doc.Styles.Add("ParaStyle", StyleType.Paragraph);
    sPara.Font.Name = "Times New Roman";
    sPara.Font.Bold = true;
    sPara.Font.Italic = true;
    doc.Body.Sections.First.GetRange().Paragraphs.Last.Style = sPara;
    ```

For more information on how to implement paragraph styling using DsWord, see [DsWord sample browser](https://developer.mescius.com/documents-api-word/demos/).