Heading

This is some text inside of a div block.
This is some text inside of a div block.
This is some text inside of a div block.
min read

Quick Bookmarks

Word • Macros • Editing
Peter Ronhovde
15
min read

I quickly set and jump between bookmarks as I edit my novels and notes in Word all with a few keyboard shortcuts.

Much faster than the clunky GoTo tab in the Find and Replace dialog.

Thanks for your interest

This content is part of a paid plan.

Create the empty macro

A previous post covers creating an empty macro like the one shown below. When you’re done, you’ll have something like:

Sub GotoPrimaryBookmark()
  ' Jump to an editing bookmark in the document

End Sub

We'll have one each for the setting and jumping to the respective bookmarks.

The single quote tells VBA the rest of the text on that line is a comment meant for human readers. We start our macro steps on the empty line.

How do I use it?

If I’m about to move to make an edit somewhere else in the document, I’ll quickly hit Command+Option+7 to set an editing bookmark at my current location.

I go where I need and make the edit. Then I hit Command+7 to jump back to my original location.

It’s quick and easy.

This is important to me because I build a running outline of scene ideas and tentative scenes in my novels with inline notes as I write.

What about the “Find and Replace” dialog?

I know this may feel like we’re reinventing the wheel, but as I’ve said before, we’re talking about streamlining your workflow. Making your whole editing process faster.

Yeah, the Find and Replace dialog (F5 in Windows or Mac; alternatively Command+Option+G in Word for Mac or Control+G in Word for Windows) is useful, but it’s a prime example of increased friction reducing its own utility.

In the effort to make it general and apply to almost everything in addition to searching for text, it’s just clunky to use.

How do we use bookmarks with the Find and Replace dialog?

  • Press F5
  • Make sure the GoTo tab is selected
  • Select bookmarks from the side panel
  • Select the appropriate bookmark from the drop down list
  • Click the GoTo button

Sometimes the GoTo tab and the proper bookmark will already be selected, but it’s still more friction than necessary.

There are a similar number of steps even if you use the Bookmarks dialog on the Insert tab of the ribbon instead.

The extra steps make people less likely to actually use either method.

They’re just long and clunky when you’re in a work flow state when you could accomplish the same thing by tapping Command+7 (my preferred keyboard shortcut).

What about the “goto last edit” shortcut?

As mentioned last article, Shift+F5 is a standard Word keyboard shortcut to cycle between the last several edits in a document, but it actually often counts individual letters as separate edits. This greatly limits it utility in practice.

Quick Bookmarks

Working with the ActiveDocument

We previous used the Selection to access a hidden Word bookmark through its Bookmarks collection:

  Selection.Bookmarks

In this macro, we’ll instead refer to the Bookmarks collection of the ActiveDocument rather than through the Selection since the latter probably doesn’t contain the editing bookmark(s) we’re using.

  ActiveDocument.Bookmarks

This collection allows us to access any defined Bookmark in the active document.

Set an editing bookmark

We can set or redefine a bookmark using the Add method of the collection.

  ActiveDocument.Bookmarks.Add Range:=Selection.Range, _
          Name:="BookmarkName"

We gave it a Range in the document for the bookmark to span. Here Selection.Range is just the current insertion point (or all content spanned by a selection if one exists).

Then we gave the new bookmark a name in double quotes. I personally use three regular editing bookmarks: PrimaryEdit, SecondaryEdit, and TertiaryEdit.

Word doesn’t allow spaces in bookmark names, but some people use an underscore _ to simulate a space like Primary_Edit. This underscore is just for the name and has nothing to do with the above line extension. Not my preference.

Recall the underscore _ character at the end of the first line above tells VBA you're continuing the long line on the next.

Don’t forget we use := to assign arguments when necessary after VBA commands.

Goto a standard bookmark

If we quickly set a standard bookmark, we need a corresponding method to jump to it. We can use the GoTo method of the Selection.

  Selection.GoTo What:=wdGoToBookmark, Name:="BookmarkName"

Remember we have to give the GoTo method a thing to jump to it using the pre-defined item constants.

If a bookmark is used as we’ve done here, we also have to give the name of the Bookmark in double quotes.

Checking whether the bookmark exists

We should probably check whether the bookmark exists before trying to access it. Otherwise, the macro will crash.

  ActiveDocument.Bookmarks.Exists("BookmarkName")

The Exists method is True if the bookmark exists in the ActiveDocument and False if not. We then use it in a conditional statement:

  If ActiveDocument.Bookmarks.Exists("BookmarkName") Then
    ' Do the bookmark step
  End If

Final macros

Unfortunately, we have to define a separate bookmark macro for each one we use. Here is how I do it:

Set the primary editing bookmark:

Sub SetPrimaryBookmark()
  ' Set or redefine an editing bookmark
  ActiveDocument.Bookmarks.Add Range:=Selection.Range, _
            Name:="PrimaryEdit"
End Sub

And the secondary version:

Sub SetSecondaryBookmark()
  ' Set or redefine an editing bookmark
  ActiveDocument.Bookmarks.Add Range:=Selection.Range, _
            Name:="SecondaryEdit"
End Sub

I’ve assigned these to Command+Option+7 and Command+Option+1 in Word for Mac using the numpad. In Word for Windows, I use Control+Alt+7 and Control+Alt+1, respectively.

I don’t understand why, but sometimes Word will even delete the added bookmarks between sessions with the document, so it's nice to able to reset them quickly.

The corresponding goto macros are:

Sub GotoPrimaryBookmark()
  ' Jump to an existing editing bookmark
  If ActiveDocument.Bookmarks.Exists("PrimaryEdit") Then
    Selection.GoTo What:=wdGoToBookmark, Name:="PrimaryEdit"
  End If
End Sub

And the secondary version:

Sub GotoSecondaryBookmark()
  ' Jump to an existing editing bookmark
  If ActiveDocument.Bookmarks.Exists("SecondaryEdit") Then
    Selection.GoTo What:=wdGoToBookmark, Name:="SecondaryEdit"
  End If
End Sub

I’ve assigned these to Command+7 and Command+1 in Word for Mac using the Numpad. In Word for Windows, I use Control+7 and Control+1, on the numpad respectively.

Improvements

The default behavior of jumping to a bookmark positions the bookmark near the top of the screen.

That's okay, but I like to keep two entire novel-sized pages on the screen at a time, so my personal implementations roughly centers the pages on the screen as I write.

Window position tweaks

Word hidden Page Range

We'll need one of those hidden Word bookmarks again. This time we'll take advantage of a standard, hidden page Range that Word defines.

  Selection.Bookmarks("\Page").Range

We just use this new page range instead of Selection.Range when setting the window page position.

ActiveWindow access

We'll need to access the ActiveWindow object to control the page position.

Scrolling the page view

There are several methods, but we'll be using ScrollIntoView.

  ActiveWindow.ScrollIntoView Selection.Bookmarks("\Page").Range

This command requires a Range, and I specified the entire page since I like to view the full page content.

Tweak the page view

The result above in various attempts usually isn't exactly right for me, so I often tweak the final position with a SmallScroll command.

  ActiveWindow.SmallScroll Down:=4

This is equivalent to clicking the small arrows on the vertical scroll bar. The number for Down (or Up) entirely depends on your view and setup. I chose 4 for this demonstration.

There are several more window positioning commands, but I try not to barrage you with unused ones.

Final Macro

We only have to add the lines to the goto bookmark variations.

Sub GotoPrimaryBookmark()
  ' Jump to an existing editing bookmark
  If ActiveDocument.Bookmarks.Exists("PrimaryEdit") Then
    Selection.GoTo What:=wdGoToBookmark, Name:="PrimaryEdit"

    ' Roughly center page on screen
    ActiveWindow.ScrollIntoView Selection.Bookmarks("\Page").Range
    ActiveWindow.SmallScroll Down:=4
  End If
End Sub

The positioning varies a little by direction and even feels like it varies over time in a way I haven't been able to nail down. Perhaps it's subtle changes in my own layout, but I have macros set to position the document basically the same way every time, so I don't know.

Affiliate Links

If you're interested in using Word or another tool related to the article, check out these affiliate links. I may make a small commission if you purchase when using them, but there is no increase in cost for you, and it helps to support this site and associated content.

I've been using Microsoft for Business for commercial use (that's us writers) on one of the lower pricing tiers for years. I get to use my macros, have online storage, and don't have to worry about software updates.