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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Macro on open in dot template

Status
Not open for further replies.

astrobill

Technical User
Dec 19, 2002
3
US
I have a macro in my word doc that runs on opening to put the cursor at a bookmark. I want to do the same in a .dot template, but can't seem to make it work. Can someone tell me how to do this? Below is the code that runs in the .doc file:

Private Sub Document_New()

End Sub

Private Sub Document_Open()
Selection.GoTo What:=wdGoToBookmark, Name:="starthere"

End Sub


 
If the .DOT file has the bookmark already in it - which I assume is the case - then use Document_New, and the same code.
Code:
Private Sub Document_New()
Selection.GoTo What:=wdGoToBookmark, Name:="starthere"
End Sub
Document_New fires when the template clones itself as a new document. If the bookmark exists, then the cursor will go there.


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

Part and Inventory Search

Sponsor

Back
Top