Insert a New Line After a Word Quick Part with VBA
Question details
The user needs to add a new paragraph after each Quick Part inserted by a Word VBA procedure.
- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A VBA procedure inserts building blocks at bookmarks, with different Quick Parts selected by conditional blocks.
- Observed behavior
- Some Quick Part and bookmark combinations produce formatting issues because a new line is needed after each insertion.
Open the document and VBA procedure that inserts the Quick Parts. Identify the range variable used for each insertion and check whether any building block already ends with a paragraph mark.
Insert a paragraph mark after each Quick Part range
Use Word VBA's InsertAfter method to add a paragraph break immediately after each inserted Quick Part.
The range must refer to the inserted Quick Part, not just the original bookmark location. BuildingBlock.Insert returns a Range that you can assign to the range variable.
In Word, open the Visual Basic Editor and locate the procedure that inserts the Quick Parts.
For each BuildingBlock.Insert call, confirm that oRng refers to the returned range containing the inserted Quick Part. If you use a different range variable, use that variable in the next step.
Immediately after the insertion, and before the corresponding End If, add: oRng.InsertAfter vbCr. Repeat this in each conditional block that needs a new paragraph.
Run the procedure with the relevant Quick Part and bookmark combinations. Check that each required paragraph break appears in the right place and that no unwanted blank lines are added.

Edit Word Documents with WPS Writer
WPS Writer is a free, lightweight Office alternative with a familiar interface and Word format compatibility for moving documents between applications. The VBA fix above applies to Microsoft Word; WPS does not fix Word's Quick Parts behavior.

Frequently Asked Questions
Where should I put the InsertAfter statement?
Place oRng.InsertAfter vbCr after the Quick Part insertion and before the End If for that conditional block. Make sure oRng refers to the inserted content.
Why does an extra blank line appear after a Quick Part?
The building block may already end with a paragraph mark. Inspect the Quick Part's ending and adjust the code so it does not add an unnecessary second paragraph mark.
Does vbCr insert a paragraph break or a manual line break?
In this Word VBA context, vbCr inserts a paragraph mark. Use it when the following content should begin in a new paragraph.
How can I make sure the break follows the inserted Quick Part?
Assign the Range returned by BuildingBlock.Insert to your range variable, then call InsertAfter on that range. Test each conditional branch and bookmark combination.




