A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open Doc and Go To



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2006, 08:33 PM posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
external usenet poster
 
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  
Old June 2nd, 2006, 08:42 PM posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
external usenet poster
 
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  
Old June 2nd, 2006, 08:48 PM posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
external usenet poster
 
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  
Old June 2nd, 2006, 11:45 PM posted to microsoft.public.word.customization.menustoolbars,microsoft.public.word.docmanagement,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
external usenet poster
 
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





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.