How do I save the cursor location?

G

Guest

Sorry but I couldn't find an answer for this one... How do I save the cursor
on a template so when I open a document from it I can start from the right
spot. Specifically, I have a text frame at the top of the page and when I
open a document from the template, the frame is highlighted. How can I start
the cursor in the desired text field, or not have a cursor starting location
at all? Please help. Thank you in advance. -- Jim
 
J

Jay Freedman

Jim said:
Sorry but I couldn't find an answer for this one... How do I save the
cursor on a template so when I open a document from it I can start
from the right spot. Specifically, I have a text frame at the top of
the page and when I open a document from the template, the frame is
highlighted. How can I start the cursor in the desired text field,
or not have a cursor starting location at all? Please help. Thank
you in advance. -- Jim

Hi Jim,

Place a bookmark at the point where you want the cursor to start. (I assume
it's not a text form field in a protected document, because then the cursor
would automatically start in the first field, and the frame could not be
selected.)

Create two macros in the template (see
http://www.gmayor.com/installing_macro.htm) that looks like this -- but
change the "StartHere" to the name of the actual bookmark.

Public Sub AutoNew()
ActiveDocument.Bookmarks("StartHere").Range.Select
End Sub

Public Sub AutoOpen()
On Error Resume Next
ActiveDocument.Bookmarks("StartHere").Range.Select
End Sub

The first macro runs when you use File > New to make a new document based on
the template, and the second one runs when you open a saved document based
on the template.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top