You’ll see hanging indents applied when you add bibliographies in Microsoft Word to satisfy the style guide requirements of certain types of academic documents. If you want to add hanging indents to a Microsoft Word document, here’s what you’ll need to do. If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.A hanging indent is used to position the first line of each paragraph against the margin, with each further line indented. 'Get the fourth paragraph and set hanging indentĭim para4 As Paragraph = doc.Sections(0).Paragraphs(3)ĭoc.SaveToFile("Indent.docx", FileFormat.Docx2010) 'Get the third paragraph and set first line indentĭim para3 As Paragraph = doc.Sections(0).Paragraphs(2)
'Get the second paragraph and set right indentĭim para2 As Paragraph = doc.Sections(0).Paragraphs(1) 'Get the first paragraph and set left indentĭim para1 As Paragraph = doc.Sections(0).Paragraphs(0) Save the document to another file using Document.SaveToFile() method.Get the paragraph format using Paragraph.Format property, and then set the paragraph indent using the above listed properties of ParagraphFormat class.Get a specified paragraph using Section.Paragraphs property.Get a specified section using Document.Sections property.Load a sample Word document using Document.LoadFromFile() method.Positive value represents first-line indent, and Negative value represents hanging indent. Gets or sets the value for first line or hanging indent.
Returns or sets the value that represents the right indent for paragraph. Returns or sets the value that represents the left indent for paragraph. The table below lists some of the core classes and properties that are used to set different paragraph indents in a Word document. PM> Install-Package Spire.Doc Set Paragraph Indents in Word