Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Black Lab[_2_] Black Lab[_2_] is offline
external usenet poster
 
Posts: 2
Default Saving the cursor position in Word docs and templates

Our company templates are suppose to have the cursor open to a specific line
when the template is opened. Upon our last update, the cursor now opens to
line 1 instead of line 15. How do I get the cursor to open on a specific
line? Thanks

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Aeneas Aeneas is offline
external usenet poster
 
Posts: 264
Default Saving the cursor position in Word docs and templates

You can copy the following macros into each template. They will place the
insertion point at the same location it was positioned when you last closed
the document.

The first inserts a bookmark at the position of the insertion point (not at
the position of the last edit) every time you both issue the command to close
a document *and* confirm in the resultant message box that you want to save
the document. If you don't save the document when closing it the bookmark
will not be inserted or if it was inserted previously it will remain in the
previous location.

Trap: Saving the document, then closing it and saying you do not want to
save the document when prompted will not insert the bookmark or reposition it.

You must *not* change either macro name -- AutoClose and AutoOpen. They are
reserved for macros that automatically execute when you close any Word
document and open any Word document, respectively.

Macro #1
Sub AutoClose()
'To insert this bookmark each time, confirm that you want to save the
document 'when closing it

With ActiveDocument.Bookmarks
..Add Range:=Selection.Range, Name:="lastinsertionpointposition"
..DefaultSorting = wdSortByName
..ShowHidden = True
End With
End Sub

Macro #2:
Sub AutoOpen()
' goes to the bookmark set via the AutoClose macro if it exists, otherwise
moves ' ' to the beginning of the document

If ActiveDocument.Bookmarks.Exists("lastinsertionpoin tposition") = True Then
Selection.GoTo What:=wdGoToBookmark, Name:="lastinsertionpointposition"
End If
End Sub

To learn how to copy macros, read the following:
http://www.gmayor.com/installing_macro.htm

"Black Lab" wrote:

Our company templates are suppose to have the cursor open to a specific line
when the template is opened. Upon our last update, the cursor now opens to
line 1 instead of line 15. How do I get the cursor to open on a specific
line? Thanks

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Black Lab[_2_] Black Lab[_2_] is offline
external usenet poster
 
Posts: 2
Default Saving the cursor position in Word docs and templates

Is there anyone other way beside creating a Macro to do this? I have 60
templates to update.


"Aeneas" wrote:

You can copy the following macros into each template. They will place the
insertion point at the same location it was positioned when you last closed
the document.

The first inserts a bookmark at the position of the insertion point (not at
the position of the last edit) every time you both issue the command to close
a document *and* confirm in the resultant message box that you want to save
the document. If you don't save the document when closing it the bookmark
will not be inserted or if it was inserted previously it will remain in the
previous location.

Trap: Saving the document, then closing it and saying you do not want to
save the document when prompted will not insert the bookmark or reposition it.

You must *not* change either macro name -- AutoClose and AutoOpen. They are
reserved for macros that automatically execute when you close any Word
document and open any Word document, respectively.

Macro #1
Sub AutoClose()
'To insert this bookmark each time, confirm that you want to save the
document 'when closing it

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="lastinsertionpointposition"
.DefaultSorting = wdSortByName
.ShowHidden = True
End With
End Sub

Macro #2:
Sub AutoOpen()
' goes to the bookmark set via the AutoClose macro if it exists, otherwise
moves ' ' to the beginning of the document

If ActiveDocument.Bookmarks.Exists("lastinsertionpoin tposition") = True Then
Selection.GoTo What:=wdGoToBookmark, Name:="lastinsertionpointposition"
End If
End Sub

To learn how to copy macros, read the following:
http://www.gmayor.com/installing_macro.htm

"Black Lab" wrote:

Our company templates are suppose to have the cursor open to a specific line
when the template is opened. Upon our last update, the cursor now opens to
line 1 instead of line 15. How do I get the cursor to open on a specific
line? Thanks

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving cursor position in Word docs and templates Black Lab Microsoft Word Help 0 November 28th 07 10:11 PM
MS Word document is opening to last cursor position Darin Microsoft Word Help 3 October 18th 06 05:51 PM
Curser position on blank docs in Word 2003 Bookworm Microsoft Word Help 2 August 31st 06 08:14 PM
Cursor position when opening Word N0mad Microsoft Word Help 5 December 9th 05 11:27 PM
How do I change the (position) cursor style in Word Harmeet Kalra Microsoft Word Help 1 May 23rd 05 10:48 AM


All times are GMT +1. The time now is 05:58 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"