Word.Tips.Net Welcome toWord.Tips.Net

Helpful Links

Tips.Net Home
WordTips Home

Ask a Word Question
Make a Comment

Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

Newest Tips

Changing Tabs Using the Ruler

Moving Drawing Objects

Standardizing Note Reference Placement

Selecting Printing of Color Pictures

Stubborn Foreign Languages

Sizing the Preview Pane

Moving Rows and Columns With the Mouse

 

Jumping to the Start or End of a Document

Summary: When creating macros, it is often necessary to move the insertion point around the document so that text can be processed in the manner desired. One of the most common movements is to move the insertion point to the beginning or ending of the document. Here's how to do it. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)

When you are creating a macro, there are many times you want to move to the beginning or end of your document. The exact syntax for how you do this depends on whether you are using WordBasic or VBA. If you are programming in VBA, you use the HomeKey and EndKey methods of the Selection object. For instance, the following two lines will move the cursor to the beginning of the document, and then to the end:

Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdStory

If you want to select everything from the current position to the beginning or end of the document, you simply add the Extend method. The following will select everything from the current location to the beginning of the document:

Selection.HomeKey Unit:=wdStory, Extend:=wdExtend

Tip #120 applies to Microsoft Word versions: 97 | 2000 | 2002 | 2003 | 2007

Document and Annotate! One of the easily overlooked tools provided by Word is the ability to add footnotes and endnotes to your documents. WordTips: Footnotes and Endnotes is the definitive resource guide to using these tools to enhance your documents.
 
Check out WordTips: Footnotes and Endnotes today!