VBA & Macro Problems

Insert a New Line After a Word Quick Part with VBA

Olivia MillerOlivia Miller Nov 14, 2026 868 views

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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA procedure

In Word, open the Visual Basic Editor and locate the procedure that inserts the Quick Parts.

2
Check the inserted range

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.

3
Add the paragraph mark

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.

4
Test the combinations

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.

Insert a paragraph mark after each Quick Part range
Check existing paragraph marks: If a Quick Part already ends with a paragraph mark, adding another may create an extra blank paragraph. Adjust the condition for that building block if necessary.
Free Microsoft Office alternative

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.

Edit documents with a familiar word-processing interfaceOpen and save Microsoft Word DOC and DOCX filesWork with paragraph formatting in documentsUse a free, lightweight alternative for everyday Office tasks
microsoft office alternative - wps office

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.