tadg.ie
Home Poetry Artwork Blog Tech Snips Plays
Bulk delete bookmarks in Microsoft Word

Bulk delete bookmarks in Microsoft Word

Taḋg Paul · 22 Apr 2025

When I convert from orgmode to Word via Open Document format, I often find the document is littered with superfluous bookmarks. These don't really do much of anything in Word, but if you share it further and someone opens it with Google Workspace vis Gmail or Google Drive, you find the doc has become a big ugly morass where you can barely read the doc. Thanks Google.

In Word's Developer tab, click on Visual Basic to open the VBA editor. In the editor, go to Insert > Module to create a new module. Then add the following code:

Sub DeleteAllBookmarks()
    Dim bm As Bookmark
    For Each bm In ActiveDocument.Bookmarks
        bm.Delete
    Next bm
End Sub

(If you need to enable the Developer tab, in Word, go to File > Options > Customize Ribbon and check the Developer option in the right pane or on the MacOS version, it's under View settings for some reason)

  • tech

Related articles

  • Image manipulation from the command line tech-snips
  • Watch Youtube with Auto-Translated Captions tech-snips
  • Firefox: disable autofill in forms tech-snips
  • Filtering and searching in hledger tech-snips
  • Auto-Deploy Hugo from Github tech-snips
© Taḋg Paul