Imports Docs.Word



Public Class Paragraphs_Style
	Friend Shared Function Main1() As Document
		'	Open the document with given name and gets all paragraphs
		Dim Doc As Document = Document.ReadDoc(Form1.SourceFolder + "Paragraphs - Style.doc")
		Dim ParList As ParagraphList = 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
	End Function
End Class
