[]
GcWord allows you to specify line spacing for a paragraph using LineSpacing property of the Spacing class which can be accessed using Spacing property of the ParagraphFormat class.
To get the line spacing 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 spacing properties applied to the paragraph using Spacing property of the ParagraphFormat class.
Get the value of the line spacing for the paragraph using LineSpacing property of the Spacing class.
Display the line spacing value on the console.
//Get line spacing
Console.WriteLine("Line spacing:" +
doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.Spacing.LineSpacing);
To set the line spacing 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 spacing properties applied to the paragraph using Spacing property of the ParagraphFormat class.
Set the line spacing rule using LineSpacingRule property of the Spacing class.
Set the value of the line spacing for the paragraph using LineSpacing property of the Spacing class.
//Set line spacing
doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.Spacing.LineSpacingRule =
LineSpacingRule.Exact;
doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.Spacing.LineSpacing = 30;
For more information on how to implement line spacing using GcWord, see GcWord sample browser.