How do I save the cursor location?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top