[]
GcWord allows you to specify the set of indentation properties for a paragraph using the Indentation class which can be accessed using Indentation property of the ParagraphFormat class.
To get the indents of a paragraph:
Access a paragraph from the paragraph collection using Paragraphs property of the RangeBase class.
Access the paragraph formatting properties using Format property of the Paragraph class.
Get the indentation properties applied to the paragraph using Indentation property of the ParagraphFormat class.
Get indentation property. For example, get the value of the first line indent of the paragraph using FirstLineIndent property of the Indentation class.
Display the indent value on the console.
//Get indents
Console.WriteLine("Indent: " +
doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.Indentation.FirstLineIndent);
To set the indents of a paragraph:
Access a paragraph from the paragraph collection using Paragraphs property of the RangeBase class.
Access the paragraph formatting properties using Format property of the Paragraph class.
Get the indentation properties applied to the paragraph using Indentation property of the ParagraphFormat class.
Set indentation property. For example, set the value of the first line indent of the paragraph using FirstLineIndent property of the Indentation class.
//Set indents
doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.Indentation.FirstLineIndent = 20;
For more information on how to implement paragraph indentation using GcWord, see GcWord sample browser.