DsWord allows you to define a style using Style class which can be accessed using Styles property of the Run class. It allows you to apply the defined style to a paragraph using Style property of the Paragraph class.
To set the paragraph style:
C# |
Copy Code |
---|---|
//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.