# Indentation

Learn how to indent a paragraph in a Word document using DsWord. You can also get the indentation properties applied to the paragraph in the document.

## Content

DsWord allows you to specify the set of indentation properties for a paragraph using the [Indentation](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Indentation.html) class which can be accessed using [Indentation](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Indentation.html) property of the [ParagraphFormat](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.ParagraphFormat.html) class.

## Get Indents

To get the indents of a paragraph:

1. Access a paragraph from the paragraph collection using [Paragraphs](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.RangeBase.Paragraphs.html) property of the [RangeBase](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.RangeBase.html) class.
2. Access the paragraph formatting properties using [Format](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Paragraph.Format.html) property of the [Paragraph](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Paragraph.html) class.
3. Get the indentation properties applied to the paragraph using **Indentation** property of the **ParagraphFormat** class.
4. Get indentation property. For example, get the value of the first line indent of the paragraph using [FirstLineIndent](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Indentation.FirstLineIndent.html) property of the **Indentation** class.
5. Display the indent value on the console.

    ```csharp
    //Get indents
    Console.WriteLine("Indent: " + 
        doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.Indentation.FirstLineIndent);
    ```

## Set Indents

To set the indents of a paragraph:

1. Access a paragraph from the paragraph collection using **Paragraphs** property of the RangeBase class.
2. Access the paragraph formatting properties using **Format** property of the **Paragraph** class.
3. Get the indentation properties applied to the paragraph using **Indentation** property of the ParagraphFormat class.
4. Set indentation property. For example, set the value of the first line indent of the paragraph using **FirstLineIndent** property of the Indentation class.

    ```csharp
    //Set indents
    doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.Indentation.FirstLineIndent = 20;
    ```

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