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 / April 2006

Tip: Looking for answers? Try searching our database.

Access bookmark in header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pat Hartman (MVP) - 27 Apr 2006 15:35 GMT
I am trying to automate word from Access and I can't seem to get the syntax
correct for referencing a bookmark in the header.

   WordApp.Selection.GoTo What:=wdGoToBookmark, Name:="CycleName"
   WordApp.Selection.TypeText Text:=rsDAO!CycleName
works fine in the body of the document but can't "see" bookmarks in the
header.  So I tried:

   ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
   WordApp.Selection.GoTo What:=wdGoToBookmark, Name:="CycleName"
   WordApp.Selection.TypeText Text:=rsDAO!CycleName

But that didn't work either.  I still got the "Word cannot find the
requested bookmark" message.

Can someone point me in the right direction?
Pat Hartman (MVP) - 27 Apr 2006 15:59 GMT
Thanks anyway.  I found a solution:

   Dim rng As Word.Range
   Dim bkm As String
   bkm = "Cycle"
   Set rng = WordDoc.Bookmarks(bkm).Range
   rng.Text = rsDAO!CycleRoman
   WordDoc.Bookmarks.Add bkm, rng

> I am trying to automate word from Access and I can't seem to get the syntax
> correct for referencing a bookmark in the header.
[quoted text clipped - 12 lines]
>
> Can someone point me in the right direction?
 
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.