Software

Use Word macros to save your place in a document

Use these two simple Word macros to temporarily bookmark a spot you want to return to later.

Large documents offer a few navigating challenges, especially when you need to jump back and forth between two areas. You could split the document, but that splits the screen and that might not be the right solution for you. Or, you could use any of the normal navigation tools and shortcuts, but it's easy to get lost that way. Using VBA, you can insert a bookmark that acts as a placeholder. Then, when you're ready to return, a single quick click is all that's required.

This technique requires two quick macros, which follow:

Public Sub InsertBookmark()
  'Insert bookmark for ssh.
  Call Bookmarks.Add("ssh", Selection.Range)
End Sub
Public Sub ReturnToBookmark()
  'Return to previously inserted bookmark.
  ActiveDocument.Bookmarks("ssh").Range.Select
End Sub

I used my initials to identify the bookmark, but you can use any string you like.

To add the macros, press [Alt]+[F11] to launch the Visual Basic Editor (VBE). In the Project Explorer, find ThisDocument for the current document. Then, enter the two sub procedures shown above.

Next, return to the document and add the macros to the Quick Access Toolbar (QAT), as follows:

  1. From the QAT dropdown, choose More Commands.
  2. From the Choose Commands From dropdown, choose Macros.
  3. In the list on the left, find InsertBookmark.
  4. Click Add to add the macro to the list of commands on the right.
  5. With the macro still selected, click Modify.
  6. In the resulting dialog, enter Mark in the Display Name control, and click OK. You could also change the macro's display icon.
  7. Repeat steps 3 through 6 to add ReturnToBookmark to the list on the right and add the display name, Return.
  8. Click OK.

In Word 2003, drag the macros to the toolbar as follows:

  1. Launch the Customize dialog box by double-clicking a toolbar or menu or by choosing Customize from the Tools menu.
  2. Click the Commands tab.
  3. Choose Macros from the Categories list.
  4. Find InsertBookmark in the Commands list and drag it to the toolbar.
  5. Find ReturnToBookmark and drag it to the toolbar.
  6. Click Close.

Using the macros is simple. When you want to mark an area, just click the Mark macro on the QAT. Then, go wherever you want. When you're ready to return to the marked spot, click Return.

About

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

25 comments
uri1090
uri1090

The macro proposed in this article is limited to the currently active document. On the other hand, if you create the macros by recording the actions that have the same effect, you can assign the macro to normal.dot and have them available in any document. For example, I recorded these 2 macros: Sub BookmarkTemp_Insert() ' ' BookmarkTemp_Insert Macro ' With ActiveDocument.Bookmarks .Add Range:=Selection.Range, Name:=" Temp_Bookmark" .DefaultSorting = wdSortByName .ShowHidden = False End With End Sub Sub BookmarkTemp_ReturnTo() ' ' BookmarkTemp_ReturnTo Macro ' Selection.GoTo What:=wdGoToBookmark, Name:=" Temp_Bookmark" With ActiveDocument.Bookmarks .DefaultSorting = wdSortByName .ShowHidden = False End With End Sub

jccharles
jccharles

F5 is already built in to Word. It takes you back 3 edits. It also marks your place if you close out of a document. When you open the document again, F5 takes you to where you left off.

bruce.ott
bruce.ott

Why not just use the Bookmark function built into Word, then Control G to move to the bookmark(s)? One can use as many bookmarks as required as long as each has a unique name. No macros, no fiddling with VBE.

mvondran
mvondran

As someone mentioned earlier, why not use actual bookmarks ... or if you're using the Styles for Heading1-3 ... and have the View > Document Map on, you can easily jump to new sections in one click.

krsmav
krsmav

A much simpler solution is to type an otherwise unused character, such as ` or ~ and then just search for it. I use it all the time. Also, remember that when you close a document, Word places a token at the cursor position. When you reload the document, you can jump to that position with Ctrl-Alt-Z.

izharaazmi
izharaazmi

Press Alt > N > K And it all there already in the Microsoft Office. isn't it?

billfranke
billfranke

I'm an editor and work on up to 6 different papers every day. I have a macro called "Stopped here". The green words are highlighted in violet, a color I don't use for any other purpose. That's what works for me. I've been doing that for about 15 years. Yes, I have to delete those words. No, I don't have to do a "Find" search for them (but I can if I want to) because of the unique color, plus I usually remember approximately where I stopped in the paper (that's because I do it in installments, labeled section by labeled section, and then label and date each section that I email to my clients). Having to deal with an MS Word bookmark is too time-consuming for me. I use the bookmark function only when I need to ask the author to look at two different parts of the paper that don't appear on the same page and so can't be pointed to using a drawing bar arrow (which won't stretch across pages).

databaseben
databaseben

i use a similar macro except that it also creates a copy of the document for me as well. sure i could manually create a book mark and manually save myself a second copy of the document, and sure i could manually goto my book mark when i reopen the document. and of course i could also rely on words built in document back up feature. but why do all this work when a simple button on the quick access toolbar can accomplish all of this and provide me with the added assurance that i am preserving my hard work? try it out: Sub SaveToTwoLocations() Dim oDoc As Document Dim strFileA As String Dim strFileB As String Dim strBackupPath As String 'Define the backup location strBackupPath = "e:\Backups\" On Error Resume Next Set oDoc = ActiveDocument With oDoc 'Mark the cursor position with a bookmark .Bookmarks.Add Range:=Selection.Range, Name:="OpenAt" .Save strFileA = .FullName strFileB = strBackupPath & "Backup " & .Name .Close 'Close the document End With FileCopy strFileA, strFileB 'Copy the document Documents.Open strFileA 'Reopen the original document ActiveWindow.View.Type = wdPrintView 'and restore the cursor position ActiveDocument.Bookmarks("OpenAt").Select End Sub

jonc2011
jonc2011

I use a macro called "Find_zzz" to temporarily bookmark a place. This can be easily recorded if you have macros enabled, but you MUST use Advanced Find in the navigation pane. A simple Ctrl F find will not work. For temporary place-holders (you can of course use as many zzzs as you want in a doc) this maybe a better option than using macros to insert and locate a bookmark. Or paste the following into your macros module in VBA Sub Find_zzz() ' Find_zzz Macro Selection.Find.ClearFormatting With Selection.Find .Text = "zzz" .Wrap = wdFindContinue End With Selection.Find.Execute End Sub

EarlMelton
EarlMelton

I did a lot of proofreading on my wife's papers when she was in graduate school. I often needed to inquire of her about meanings before I would change something. Simplest method I came up with was just to use 3 X's at the beginning of the word/phrase/paragraph/whatever. When I got with her and came back to it, Ctrl+F would find it (them, if multiples) immediately. It was so simple and fast, I would probably still use it.

SocratesChildren
SocratesChildren

The simplest bookmark is to simply close the document where you are working. When you return use CTL+F5 to return to that spot. As you work the document this "bookmark" shifts to the last place you worked. Useful for taking a break from the computer, or moving to a task in other software.

deedeenicole
deedeenicole

That's the most heavy-handed attempt at avoiding proper tools in word that I've ever seen. Just use the "INSERT BOOKMARK" feature. You can easily setup multiple points to jump around in your document. And there are built in key-strokes and toolbar buttons already created. You just have to use them.

moganti
moganti

Can't these be added to run on close and open document? Thanks for sharing.

hkammann
hkammann

What a great trick. Thanks for sharing

ssharkins
ssharkins

That's useful and thanks for mentioning it -- but this macro doesn't do the same thing, although, it will often seem to. With this macro, you can go anywhere, do anything, for any length of time -- and return to a specific spot, not one of the last three edits you made. What if you've made many edits? But, I'm glad you mentioned this -- definitely worth sharing! Thank you!

jonc2011
jonc2011

I use *, which I insert at every location in reports I am writing where I need to edit or add more information later. Easy when you are finalizing the doc to search for *, edit the text, then remove all asterisks. But I still use my "Find zzz" macro as a temporary place marker. Bookmarks are great for cross-referencing but no use for temporary place marking.

ssharkins
ssharkins

That launches the bookmark dialog. Then, you then have to stop and enter a bookmark name. Then, it's a few keystrokes to then return to that bookmark later. I think a couple of clicks on the QAT are a lot more efficient! ;)

billfranke
billfranke

It's also possible to set Word to automatically make a backup copy (with a *wbk extension) of your document. That means that you have to save the document while you're working on it, but I do that automatically anyway because I've lost too many docs for a variety of reasons, so I'm pretty obsessive about making backups. But I like your creative and intelligent solution to two problems with one macro.

ssharkins
ssharkins

The macros only work with one placeholder at a time, so I guess if you're working with multiple placeholders, this would work well, except, you have to remember to remove the zzzs, right?

ssharkins
ssharkins

Glad you found a simple solution.

ssharkins
ssharkins

What if the user doesn't want to close the document to take advantage of that -- it's good to know that capability exist and I'm glad you mentioned it, but these are used differently. You'd use them with, not instead of the built-in bookmarking feature. And keep in mind, these macros are constantly updated as the user works.

deedeenicole
deedeenicole

But this "solution" addresses moving to different spots in the document while you're working. The shortcut F5 doesn't really do that.

ssharkins
ssharkins

You could do that I suppose, but these can be used in the same work session.

databaseben
databaseben

yeah, i recall so many nights fussing over lost documents and the time and energy creating them, because office and windows decided to be unreliable when you least expect it. what is also useful is google doc's because it saves revisions and drafts.

jonc2011
jonc2011

However, the good thing is that when you click the "Find zzz" macro button on the quick access toolbar, it goes to and selects the next zzz, so it is simple matter to click delete, then click on to the next one if you want. I seldom use more than 2 or 3, but it is useful for toggling between two (or more) locations in a document and can avoid having to split the screen. Interesting that a simple Ctrl F find won't record keystrokes in saving a Word 2010 macro and the need to use advanced find. Any idea why? Ctrl F works ok in Excel.