Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Go to a bookmark in the header in New Doc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ItsBarbara - 03 Oct 2006 02:45 GMT
Is there a way I can have the user go to a bookmark in the header upon
opening a template for the first time?I'm trying to make a document more
user friendly. The document is one created by the district that everyone on
staff needs to complete and there are a variety of abilities.  I added a
hyperlink (hidden text) to get them out of the header after they enter the
Header Data....but many are frustrated upon getting into the header....
Jean-Guy Marcil - 03 Oct 2006 03:52 GMT
ItsBarbara was telling us:
ItsBarbara nous racontait que :

> Is there a way I can have the user go to a bookmark in the header upon
> opening a template for the first time?I'm trying to make a document
[quoted text clipped - 3 lines]
> header after they enter the Header Data....but many are frustrated
> upon getting into the header....

It is much easier to have a userform (or an InputBox if the text to enter is
short and simple) by means of which the user can type the desired text.
Then, the code inserts the text in the header without opening it.

Here is a simple example with an InputBox (You will need a Bookmark named
"Test" in the main header of section #1.)

'_______________________________________
Dim strText As String

strText = InputBox("Type your text:", "Header Data")

'Will equal "" when user hits Cancel
If strText = "" Then Exit Sub

ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary) _
   .Range.Bookmarks("Test").Range.Text = strText
'_______________________________________

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.