bottom
Great WordTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > WordTips Home > Macros > Moving the Insertion Point to the Beginning of a Line

Moving the Insertion Point to the Beginning of a Line

Summary: If you need to move the insertion point within your macro, then you’ll want to note the HomeKey method, described in this tip. It can be used to move the insertion point to the beginning of a line of text. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)

If you need to move the insertion point to the beginning of a line while running a VBA macro, it is done with the HomeKey method. Syntax examples are as follows:

Selection.HomeKey Unit:=wdLine, Extend:=wdMove
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend

The first line simply moves the insertion point, the second moves it and selects all the text between the current insertion point and the start of the line.

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


Take Control! Experienced users know that styles can make the difference between a plain document and a masterful one. This is the real power behind Word, and the key to that power can be found in WordTips: Styles and Templates.

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Vital News Home

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

 

Great Info!

Get tips like this every week in WordTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)