Hack 37 Delete All Bookmarks in a Document![]() ![]() document's bookmarks at once. This hack shows you how to do it with some VBA.Bookmarks let you quickly navigate through a document. But if you will eventually import your document into another program, such as Quark or FrameMaker, those bookmarks can cause troublefor example, FrameMaker attempts to convert some bookmarks into its own similar "marker" feature, but it often creates unresolved cross-references that you must delete. Conversely, when exporting to Word format from another program, the program may create bookmarks of questionable value in the Word document.You can select Insert time, but if a document has dozens or more, you'll be clicking for a while. The macro in this hack will delete them all at once. 4.12.1 The CodePlace this macro in the template of your choice [Hack #50] and either run it from the Tools dialog or put a button for it on a menu or toolbar [Hack #1].The following macro deletes every bookmark in a document: Sub DeleteAllBookmarks( ) 4.12.2 Hacking the HackWord hides some of the bookmarks it creates, such as the ones for cross-references, by default. A hidden bookmark isn't included when iterating through each bookmark in a document, unless the "Hidden bookmarks" box in the Insert dialog is checked. To be sure you get all of them, this version of the macro turns on that setting before running: Sub DeleteAllBookmarksIncludingHidden( ) |