#1   Report Post  
Posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
Raymond
 
Posts: n/a
Default Open Doc and Go To

Hello,

Hope I can get some instruction on how to set a template so that the new
document opens with the cursor located further on in the document at some
book mark. I think maybe using a Go To comand in a macro that runs when the
document starts, but I don't know how to do it...

Please help if you have suggestions...

Thanks!
Raymond


  #2   Report Post  
Posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
Greg Maxey
 
Posts: n/a
Default Open Doc and Go To

Insert a bookmark where you want the document to open. Lets call it
"OpenHere"

Use something like:
Sub AutoOpen()
ActiveDocument.GoTo What:=wdGoToBookmark, Name:="OpenHere"
'or
Dim oRng As Word.Range
Set oRng = ActiveDocument.Bookmarks("OpenHere").Range
oRng.Select
End Sub




Raymond (REMOVE) wrote:
Hello,

Hope I can get some instruction on how to set a template so that the new
document opens with the cursor located further on in the document at some
book mark. I think maybe using a Go To comand in a macro that runs when the
document starts, but I don't know how to do it...

Please help if you have suggestions...

Thanks!
Raymond


  #3   Report Post  
Posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
Jay Freedman
 
Posts: n/a
Default Open Doc and Go To

Let's say you name the bookmark "StartHere". Then this code in the template
will place the cursor at the bookmark when a new document is created:

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

The AutoNew macro name is special -- it runs automatically when a new
document is created from the template (and not at any other time, unless you
manually start it).

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Raymond wrote:
Hello,

Hope I can get some instruction on how to set a template so that the
new document opens with the cursor located further on in the document
at some book mark. I think maybe using a Go To comand in a macro that
runs when the document starts, but I don't know how to do it...

Please help if you have suggestions...

Thanks!
Raymond



  #4   Report Post  
Posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
Raymond
 
Posts: n/a
Default Open Doc and Go To

This is great, just the thing i thought I should be looking for! Now i just
need to figure out how I put this code into my template. The only macros
i've been able to devise have been by recording the keystrokes...

Thanks so much for the info!

Raymond


"Jay Freedman" wrote in message
...
Let's say you name the bookmark "StartHere". Then this code in the
template
will place the cursor at the bookmark when a new document is created:

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

The AutoNew macro name is special -- it runs automatically when a new
document is created from the template (and not at any other time, unless
you
manually start it).

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so
all may benefit.

Raymond wrote:
Hello,

Hope I can get some instruction on how to set a template so that the
new document opens with the cursor located further on in the document
at some book mark. I think maybe using a Go To comand in a macro that
runs when the document starts, but I don't know how to do it...

Please help if you have suggestions...

Thanks!
Raymond





Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump


All times are GMT +1. The time now is 12:39 PM.

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"