VBA & Macro Problems

Delete a Blank Paragraph After a Word Bookmark with VBA

Jason MillerJason Miller Nov 22, 2026 868 views

Question details

Delete an address line stored in a Word bookmark without leaving an empty paragraph.

Delete a Blank Paragraph After a Word Bookmark with VBA
Product
Microsoft Word VBA
Device & OS
not provided
Scenario
A macro removes the contents of an address bookmark, and the user wants the next address line to move up.
Observed behavior
An empty paragraph remains after the bookmarked text is deleted.
Before you start

Confirm that the bookmark is named bmAddress2 and covers the paragraph mark as well as the address text. In Word, select Home > Show/Hide ¶ to make paragraph marks visible.

Solution 1Recommended

Delete the bookmark range, including the paragraph mark

Use the bookmark's Range property to remove its contents and paragraph mark together.

The paragraph mark must be inside the bookmark range; deleting a range that contains only the address text will leave the empty paragraph behind.

1
Check the bookmark range

In Word, turn on Home > Show/Hide ¶. Open Insert > Bookmark, select bmAddress2, and choose Go To to inspect its range. If the paragraph mark is outside the selection, select the complete address paragraph including ¶, then use Insert > Bookmark to redefine bmAddress2.

2
Edit the macro

Open Developer > Visual Basic, find the procedure that removes the address line, and use this statement: ActiveDocument.Bookmarks("bmAddress2").Range.Delete

3
Run and check the result

Run the macro from Developer > Macros, then check the address block in the document. The next line should move up if the deleted range included the paragraph mark.

Delete the bookmark range, including the paragraph mark
Bookmark removal: Deleting the bookmark range also removes the bookmark. If the macro may run again, check ActiveDocument.Bookmarks.Exists("bmAddress2") before accessing it. Word's final paragraph mark cannot be deleted.
Free Microsoft Office alternative

Edit Address Lines in WPS Writer

WPS Office is a free, lightweight alternative for editing Word documents. Its familiar interface and Microsoft Word format compatibility make it easy to move documents over and adjust address lines manually. It does not fix a Microsoft Word VBA macro.

Edit address blocks and remove unwanted blank paragraphs in WPS WriterOpen and edit Microsoft Word DOC and DOCX filesUse a familiar document-editing interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does a blank line remain after I delete the bookmark text?

The bookmark range may contain the text but not the paragraph mark. Turn on Home > Show/Hide ¶ and check the bookmark selection through Insert > Bookmark.

What is the difference between deleting a bookmark and deleting its range?

Bookmarks("bmAddress2").Delete removes the bookmark marker but leaves its text. Bookmarks("bmAddress2").Range.Delete removes the content in the range as well.

How can I prevent an error if the bookmark no longer exists?

Use ActiveDocument.Bookmarks.Exists("bmAddress2") to check for the bookmark before calling its Range.Delete method.

Will deleting the bookmark range always remove the paragraph?

No. The range must include the paragraph mark, and Word's final paragraph mark cannot be deleted. Check the selection with formatting marks visible before running the macro.