You have already learned how to move the insertion point within a document by using key combinations as well as the horizontal and vertical scroll bars (in the section "Moving the Insertion Point"). In the following sections, you'll learn some additional ways to move through a document. These techniques are especially useful for larger documents.
You can use Word's bookmarks to mark and then quickly return to specific positions in a document.
To mark a position in a document, you need to define a bookmark using the following method:
Figure 6-12. Defining a bookmark named start in the Bookmark dialog box.
You can use this technique to mark any number of positions in a document. Note that you can make bookmarks visible by choosing Options from the Tools menu, clicking the View tab, and selecting the Bookmarks option (in the Show area); Word will then display an I-beam symbol at the location of each bookmark or, if you marked a block of text, Word will place bracket markers around the bookmark text.
Bookmarks can be used for a variety of other purposes, some of which will be discussed later in the book—for example, for specifying the target of a hyperlink (discussed in "Inserting and Navigating with Hyperlinks"), for defining cross-references, and for creating index entries that refer to a range of pages. (Indexes are discussed in "Creating Indexes and Tables of Contents"
To move the insertion point to a position marked with a bookmark, open the Bookmark dialog box (choose Bookmark from the Insert menu or press Ctrl+Shift+F5), select the name that you assigned when you defined the bookmark (in step 3 above), and click the Go To button. Word will immediately move the insertion point to the marked position. You can also use the Go To command, discussed in the next section, to move to a particular bookmark.
If you select a block of text prior to defining a bookmark, the bookmark will be assigned to the entire selection. In this case, when you go to the bookmark, Word will select the text.
You can use the Go To command to move the insertion point (or the selection highlight) to a position marked by a bookmark or to one of a variety of other locations in a document. To issue the Go To command, choose Go To from the Edit menu, press Ctrl+G or F5, or double-click anywhere on the left half of the status bar. Word will display the Go To tab of the Find And Replace dialog box (shown in Figure 6-13).
Figure 6-13. Using the Go To command to move the insertion point to the start bookmark.
To go to one of the other types of targets, select the appropriate item in the Go To What list, and then enter the number or name for the particular target into the text box, which will be labeled appropriately—for example, Enter Page Number or Enter Bookmark Name. (For certain types of targets, such as bookmarks or comments, you can select the name of the target from a list.) For example, to go to a specific page in your document, select Page in the Go To What list, and then type the page number in the Enter Page Number box.
Likewise, to go to a particular document line, select Line and type the line number in the Enter Line Number box. (Note that for the Go To command, line numbering begins at 1 with the first line in the document and is incremented throughout the rest of the document. In contrast, the line number displayed on the status bar refers to the number of the line within the current page).
For any type of target except a bookmark, if you don't enter a specific target into the text box, the dialog box will display buttons labeled Next and Previous. You can use these buttons to browse through the different instances of the target item. For example, if you select Section in the Go To What list and leave the Enter Section Number text box blank, clicking Next will take you to the beginning of the next document section and clicking Previous will take you to the beginning of the previous one. (Document sections are discussed in chapters 9 and 11.)
Finally, you can enter a plus (+) or minus (-) sign followed by a number in the text box to move forward or back by a certain number of items. For example, if you've selected Page in the Go To What list, you can enter +4 in the Enter Page Number box to move forward by four pages.
You can leave the Find And Replace dialog box open while you work in your document. After you close it, you can press the Shift+F4 key to repeat your last command on the Go To tab (for example, going to a specific bookmark, or going to the next footnote). Unfortunately, however, the Shift+F4 key is also used to repeat the last Find operation. (This is described in "Finding and Replacing Text"). Therefore, if you perform a Find, you can no longer use Shift+F4 to return to your last Go To target. (Likewise, if you use the Go To command, you can no longer press Shift+F4 to repeat your last Find.) Note that you can also use the browse buttons, as discussed in the next section, to find the next or previous instance of your most recent Go To or Find target.
Another way to move through a document is to press Shift+F5, the Go Back key. Each time you press Shift+F5, Word moves the insertion point back to the location where you most recently added or edited text. You can move to three prior positions, at most; if you press the key a fourth time, the insertion point will cycle back to its original position.
Writing Macros for Saving and Restoring Your Place in a Document
This sidebar provides instructions for recording a convenient pair of macros that use bookmarks for saving your place in a document and for rapidly returning to that place. It also provides some suggestions for other macros you might create to automate Word tasks. For detailed general instructions on recording, writing, and editing macros in Office applications, see Part 11 of this book, "Using Visual Basic to Supercharge Office. "
The first macro, named SavePlace, lets you save the insertion point's current position (or the current selection) by pressing Ctrl+Shift+S. The second macro, named ReturnToPlace, lets you later return the insertion point to the saved position (or restore the saved selection) by pressing Ctrl+Shift+R.
You can define the SavePlace macro in the following manner:
- Begin recording the macro by double-clicking the REC indicator on the status bar and typing the macro name SavePlace into the Record Macro dialog box. Make sure that All Documents (Normal.dot) is selected in the Store Macro In list box so that the macro will be saved where it's available to all documents you work on.
- To define the shortcut key combination, click the Keyboard button in the Record Macro dialog box to open the Customize Keyboard dialog box. Make sure the insertion point is in the Press New Shortcut Key text box, and press the Ctrl+Shift+S key combination. Click Assign, and then click Close. This returns you to your document, ready to record your macro. (By doing this, you will be replacing a shortcut key combination for opening the Style dialog box or activating the Style list box on the Formatting toolbar when this toolbar is visible.)
- Choose Bookmark from the Insert menu to open the Bookmark dialog box.
- Type the bookmark name MarkedLocation into the Bookmark Name text box, and click the Add button.
- Stop recording the macro by clicking the Stop Recording button on the Stop Recording toolbar (which is displayed automatically when you start recording a macro).
You can define the ReturnToPlace macro as follows:
- Begin recording the macro by double-clicking the REC indicator on the status bar and typing the macro name ReturnToPlace. Make sure that All Documents (Normal.dot) is selected in the Store Macro In list box.
- Define the shortcut key by clicking the Keyboard button and, in the Customize Keyboard dialog box, pressing the Ctrl+Shift+R key combination, clicking Assign, and t hen clicking Close.
- Choose Bookmark from the Insert menu.
- Select the bookmark name MarkedLocation in the Bookmark Name box, click the Go To button, and click the Close button.
- Stop recording the macro by clicking the Stop Recording button on the Stop Recording toolbar.
You can now test these macros as follows: Place the insertion point anywhere in a document (or select a block of text), and then press Ctrl+Shift+S. This will save your position (or selection). Then move the insertion point anywhere else within the same document, and perform any editing or formatting actions you want. When you're ready to go back to your original location in the document, press Ctrl+Shift+R; Word will immediately move the insertion point back to its original position (or restore the original selection).
The following are several additional examples of macros that you might record:
- Record a pair of macros to turn the Wrap To Window option on or off. This option breaks each line at the right edge of the window, rather than at the position where it will be broken on the printed page. You might want to select this option while you're editing in Normal view so that the window contains the maximum amount of text, but then turn it off to view the actual positions of line breaks on the printed copy. To create the first macro, start recording, and then choose Options from the Tools menu, click the View tab, and select the Wrap To Window option (in the Outline And Normal Options area). To record the second macro, perform these same steps but turn off the option.
- Record a pair of macros to switch between the blue window background and the white window background. You might want to enable the blue background to prevent eyestrain, but then switch to the white background to view items that are hard to see with a blue background (for example, dark lines drawn with Word's Drawing toolbar). To create the first macro, start recording, choose Options from the Tools menu, click the General tab, and select the Blue Background, White Text option. To record the second macro, perform these same steps but deselect the option.
- Write a macro to prepare a document for printing. Such a macro would be useful if you like to write and edit a document with one set of formatting features, such as single line-spacing and a large monospaced font (such as 12-point Courier New), but you want to print the document using a different set of formatting features, such as double line-spacing and a small proportional font (such as 10-point Times New Roman). In recording the macro, perform all actions that are necessary for printing the document, such as assigning different formatting features to the document's styles. Run the macro just before printing.
Word provides a set of browse buttons at the bottom of the vertical scroll bar. These convenient buttons allow you to quickly locate various types of objects within your documents. Figures 6-14 and 6-15 show you how.
Figure 6-14. How to use the browse buttons.
Figure 6-15. The Pop-up menu of browse objects displayed when you click the middle browse button (Select Browse Object).
Should you use the browse buttons rather than the Go To command? On the negative side, the browse buttons don't provide some of the targets that the Go To command offers (such as Line and Bookmark). Also, you can't specify a particular item number (for example, you can't go directly to page 25); you can only browse forward or back through the objects. On the plus side, the browse buttons are quicker to use. Also, if you've previously used the Find command or the Go To command, you can just click the Next or Previous browse button to instantly go to the next or previous Find or Go To target, without the need to first select a browse object on the pop-up menu.
If you select the Edits browse object, clicking the Previous button has the same effect as pressing the Go Back key (Shift+F5) that was described in the prior note. Clicking the Next button moves you through your most recent edits in the opposite order.
A final navigation tool discussed in this chapter is the hyperlink. You can assign a hyperlink to a block of text or to a graphic image in a Word document. The hyperlink connects the block or image to a target location, which can be in the same Word document, or in another document or Web page on a disk, network, or Internet site. Clicking the hyperlink displays the target location. You can click a hyperlink when a document is open in Word, or—for a Web-page document—when it's displayed in a browser. Hyperlinks can be useful in any type of Word document, but they are especially important in Web-page documents (that is, documents you save in HTML format for viewing in Web browsers), where you can use them to tie together the pages in your Web site or to connect to other sites.
To create a hyperlink, first select the text (or graphic image) to which you want to assign the hyperlink, or simply place the insertion point at the position in your document where you want Word to insert the hyperlink text that you later specify. Then open the Insert Hyperlink dialog box by choosing Hyperlink from the Insert menu (or from the pop-up menu that appears when you right-click anywhere in the document), by clicking the Insert Hyperlink button on the Standard toolbar, or by pressing Ctrl+K. In the Insert Hyperlink dialog box, specify the target location for the hyperlink, as shown in Figure 6-16.
Figure 6-16. Defining a hyperlink in the Insert Hyperlink dialog box.
To specify a different document or Web page as the target of the hyperlink, select the Existing File Or Web Page item on the Link To bar. (This item is selected in Figure 6-16.) To specify a target location within the current document, select the Place In This Document item, and then select either a heading or a bookmark from the list that's displayed. To create a new document and make it the target of the hyperlink, select the Create New Document item, and enter a document name and location. And finally, to have the hyperlink send a message to a particular Internet e-mail address (rather than opening a document or page), select the E-Mail Address item on the Link To bar, and then enter the e-mail address and message subject.
When you click the OK button in the Insert Hyperlink dialog box, the hyperlink will be assigned to the block of text or image in your document. By default, hyperlink text will initially be blue and underlined. After you have followed the hyperlink (that is, clicked it in Word or in a browser, to open the target), the color will change to violet. You can change the format of an unfollowed or a followed hyperlink by modifying the Hyperlink or FollowedHyperlink built-in Word style. (For instructions, see "Modifying Styles") The hyperlink colors will also be modified by applying a theme to the document.
To modify a hyperlink you have already defined, select the text or image again, and then use any of the techniques that were given for opening the Insert Hyperlink dialog box. The dialog box will now be labeled Edit Hyperlink. You can use it to modify the hyperlink, or you can click the Remove Link button in the lower left corner of the dialog box to remove the hyperlink from the text or image in your document.
For information on using the Document Map to rapidly move through a document, see "Browsing Through Outline Headings."
If you click a hyperlink in Word, and if the target of that hyperlink is a regular Office document (that is, one saved in native format, not HTML), you can use the Web toolbar to navigate back and forth through the document locations you have visited or to open other documents. (This toolbar is further described in "Using the Web Toolbar") When you first click the hyperlink, the Web toolbar is displayed automatically. (You can display it at any time by pointing to Toolbars on the View menu or by right-clicking a menu or toolbar, and then choosing the Web option.)