salvatorefalco.com

salvatorefalco.com header image 2

Using the “StartHere” bookmark

August 22nd, 2007 · No Comments

In the interest of making this blog useful to other writers rather than a merely self-indulgent waste of time (that’s what my LiveJournal is for), here’s the first in an occasional series of tips for making Microsoft Word more useful.

When I’m editing my novel, I often want to mark the spot where I leave off at the end of a session. That way, I can easily return to that location during my next editing session without having to scroll around–because I am THAT lazy. Word’s Bookmark feature helps, but still requires a lot of work. I have to go through the hassle of inserting the bookmark and deleting it when I’m done with it–not to mention all the steps necessary to jump to it. It makes me tired just thinking about it.

Better productivity through laziness, that’s my motto. I created a Word macro that:

  • Checks to see if there’s already a “StartHere” bookmark in the document.
  • If there is, jumps to its location in the document and then deletes it.
  • If not, inserts one at the current cursor location.

Here’s the code:

Sub StartPoint()

Dim i As Integer

If ActiveDocument.Bookmarks.Count > 0 Then
 For i = 1 To ActiveDocument.Bookmarks.Count
  If ActiveDocument.Bookmarks(i).Name = "StartPoint" Then
   Selection.GoTo What:=wdGoToBookmark, Name:="StartPoint"
   Selection.Find.ClearFormatting
   ActiveDocument.Bookmarks(i).Delete
   Exit Sub
  End If
 Next
End If

ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="StartPoint"

End Sub

I assigned a keystroke combination to the macro and also put a button for it on the Standard toolbar so that I can invoke it whether my hands are on the keyboard or I’m using the mouse.

Want to use this macro yourself? Here’s how:

  1. Select all the code above between (but not including) Sub StartPoint() and End Sub. Copy it to the clipboard.
  2. Fire up Word if it isn’t already started.
  3. Select Tools > Macros. The Macros dialog displays.
  4. Under Macro name, type StartPoint.
  5. Click Create. The Microsoft Visual Basic window displays. The cursor is above End Sub.
  6. Paste the clipboard contents into the window.

When you are done, close the window.Next, you’ll need some way to invoke the macro. This can be a keyboard shortcut, a menu item, or a toolbar button–or you can go for broke and create all three.

To assign a keyboard shortcut:

  1. Select Tools > Options.
  2. Select the Commands tab.
  3. Click Keyboard… The Customize keyboard dialog displays.
  4. In the Categories pane (left side), scroll down to Macros and select it.
  5. In the Macros pane (right side), select StartPoint.
  6. Click to place the cursor in Press new shortcut key.
  7. Press the shortcut key combination that you want to use. I use Alt + M. Text will appear telling you if the combination is currently assigned to another command.
  8. When you are satisfied with your selection, click Assign and then click Close.

To add a menu item or a toolbar button:

  1. Select Tools > Options.
  2. Select the Commands tab.
  3. In the Categories pane, scroll down to Macros and select it. The macro is shown in the Commands pane on the right.
  4. Select the macro on the right and drag it to the toolbar or menu location where you want to place the command. Customize the button image if you want to.
  5. Click Close.

Viola! Your new command is ready to use. Have fun.

Tags: Word Tips

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment