bookmarks in footer of Word doc not filled by ACCESS

G

Guest

When filling bookmarks that are specified in the FOOTER of a WORD doc,
they are not filled ! on of they are located in the body.
Is this a bug in WORD ?
Or is my code wrong ?
How to solve this issue ?
thanks for your help.

Set oApp = CreateObject("Word.Application")
oApp.Documents.Open strInputFile

With oApp.Selection
.GoTo Name:="OpdrAnoOmschr"
.Typetext Text:=Rsa("OpdrAnoOmsch")

.GoTo Name:="OpdrMainRefNum"
.Typetext Text:=Rsa("OpdrMainRefNum")
End With

oApp.Visible = True

greetings
Marc.
 
A

Alex Dybenko

this is not a bug
header and footer you have to handle separate, like this:

set doc=oApp.Documents.Open( strInputFile)
dim r as range
set r=doc.Sections.Last.Footers(StoryType).Range
'StoryType will define type of header, see help

so you have a reference to range, now you can use r.Find to find bookmark

bit complicated, but this is the only way i found
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top