Inserting Paragraphs

You can use any of the following methods to add new paragraphs to a document:


Paragraphs.Add

Adds a new paragraph before the first paragraph in the current selection

ActiveWindow.Selection.Paragraphs.Add Range:=ActiveWindow.Selection.Paragraphs(1).Range 

Range.InsertParagraph

This replaces the specified range or selection with a new paragraph.
If you do not want to replace the range or selection you should collapse the range or selection first.

Set oRange = ActiveWindow.Selection.Paragraphs(1).Range.InsertParagraph 

This is equivalent to the following:
After this method has been called the oRange object represents the new paragraph.

Set oRange = ActiveWindow.Selection.Paragraphs(1).Range 
oRange.InsertParagraph

This inserts a new paragraph at the beginning of the active document.

Set oRange = ActiveDocument.Range(Start:=0, End:=0) 
oRange.InsertParagraph

This inserts a new paragraph at the end of the active document.

Set oRange = ActiveDocument.Content 
oRange.Collapse Direction:=wdCollapseDirection.wdCollapseEnd
oRange.InsertParagraph
oRange.Move Unit:=wdUnits.wdParagraph, Count:=1

Range.InsertParagraphAfter

This inserts a new paragraph after the specified range or selection
After this method has been called the specified range or selection is expanded to include the new paragraph.


ActiveWindow.Selection.InsertParagraphAfter 

ActiveWindow.Selection.Paragraphs(1).Range.InsertParagraphAfter 

This inserts a paragraph at the end of the active document

ActiveDocument.Content.InsertParagraphAfter 

Range.InsertParagraphBefore

This inserts a new paragraph before the specified range or selection


ActiveWindow.Selection.Paragraphs(1).Range.InsertParagraphBefore 

This line is identical to the following line

ActiveWindow.Selection.Paragraphs.Add Range:=ActiveWindow.Selection.Paragraphs(1).Range 


© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited TopPrevNext