using System; using System.Drawing; using Docs.Word; namespace SampleManager { class Paragraphs_Style { internal static Document Main1() { // Open the document with given name and gets all paragraphs Document Doc = Document.ReadDOC(Form1.SourceFolder + "Paragraphs - Style.doc"); ParagraphList ParList = Doc.Sections[0].GetParagraphs(); // Change style properties of 1st paragraph ParList[0].Style.Alignment = Alignment.Left; ParList[0].Style.Indents.FirstLine = 30; ParList[0].Style.Shading = new Shading(Color.OrangeRed); // Change style properties of 2nd paragraph ParList[1].Style.Alignment = Alignment.Justified; ParList[1].Style.Borders = new Borders(1, BorderStyle.Double, Color.DarkCyan, 10); // Change style properties of 3rd paragraph ParList[2].Style.Alignment = Alignment.Center; ParList[2].Style.Spacings.LineSpacing.Spacing = 20; ParList[2].Style.Indents.Left = 50; ParList[2].Style.Shading = new Shading(Color.Yellow, Color.GreenYellow, ShadingStyle.VerticalStripe); ParList[2].Style.Spacings.SpacingAfter = 40; // Change style properties of 4th paragraph ParList[3].Style.Alignment = Alignment.Right; ParList[3].Style.Spacings.LineSpacing.Type = LineSpacingType.Lines; ParList[3].Style.Spacings.LineSpacing.Spacing = 2; return Doc; } } }