Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Point the cursor at a specific cell upon start in MS Word

Status
Not open for further replies.

piyushdabomb

IS-IT--Management
Aug 15, 2007
3
0
0
US
Team,

I have a Microsoft Word Document by which I need to have the cursor start pointing at a specific cell whenever I open the document. Right now, the cursor points on the top left of the page (which makes sense).

Since I am trying to use VBA in MS Word's tables, having the start at a specific point in the page will provide ease of automation.

Any advise is greatly appreciated
 
This is very easy, although it takes a wee bit of VBA code. I use a version of this to always open my documents at the last location the cursor was at when the document was closed.

1. Put a bookmark where you want to go to. Name it, say, "there".

2. Put the following into the ThisDocument module of the document.
Code:
Sub Document_Open()
Selection.GoTo what:=wdGoToBookmark, Name:="there"
End Sub
Whenever the document is opened it will move the Selection to that bookmark.

Have a question though.
Since I am trying to use VBA in MS Word's tables,
Are you using Selection for this? If you are...stop. It is MUCH better to not use Selection. You can access, and action, anything you want directly, without using, or moving the Selection (cursor).

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top