Takeaway: Use these two simple Word macros to temporarily bookmark a spot you want to return to later.
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 SubI 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:
- From the QAT dropdown, choose More Commands.
- From the Choose Commands From dropdown, choose Macros.
- In the list on the left, find InsertBookmark.
- Click Add to add the macro to the list of commands on the right.
- With the macro still selected, click Modify.
- In the resulting dialog, enter Mark in the Display Name control, and click OK. You could also change the macro’s display icon.
- Repeat steps 3 through 6 to add ReturnToBookmark to the list on the right and add the display name, Return.
- Click OK.
In Word 2003, drag the macros to the toolbar as follows:
- Launch the Customize dialog box by double-clicking a toolbar or menu or by choosing Customize from the Tools menu.
- Click the Commands tab.
- Choose Macros from the Categories list.
- Find InsertBookmark in the Commands list and drag it to the toolbar.
- Find ReturnToBookmark and drag it to the toolbar.
- Click Close.
0 komentar:
Posting Komentar