I don't know if anyone else is interested in this, but I FINALLY got the
solution to this.
First I needed to go to 'references' in the miscrosoft access module and
check off the 'microsoft word object library'. Then, the following code
worked (I got the solution from the microsoft website):
Function FindBMark()
Dim WordObj As Word.Application
Dim WordDoc As Word.Document
Dim WordRange As Word.Range
Set WordObj = CreateObject("Word.Application")
Set WordDoc = WordObj.Documents.Open("C:\test.doc")
WordObj.Visible = True
Set WordRange = WordDoc.Goto(What:=wdGoToBookmark, Name:="bktestname")
WordRange.InsertAfter "sarah is a winner"
WordObj.Quit SaveChanges:=wdSaveChanges
Set WordObj = Nothing
End Function
My new problem is that this code wil not find a bookmark located in a header
or footer of the word document, so I'm off to solve that one. If anyone has
any ideas on that please shoot them my way.
Thanks!
Sarah
[Non-text portions of this message have been removed]
solution to this.
First I needed to go to 'references' in the miscrosoft access module and
check off the 'microsoft word object library'. Then, the following code
worked (I got the solution from the microsoft website):
Function FindBMark()
Dim WordObj As Word.Application
Dim WordDoc As Word.Document
Dim WordRange As Word.Range
Set WordObj = CreateObject("Word.Application")
Set WordDoc = WordObj.Documents.Open("C:\test.doc")
WordObj.Visible = True
Set WordRange = WordDoc.Goto(What:=wdGoToBookmark, Name:="bktestname")
WordRange.InsertAfter "sarah is a winner"
WordObj.Quit SaveChanges:=wdSaveChanges
Set WordObj = Nothing
End Function
My new problem is that this code wil not find a bookmark located in a header
or footer of the word document, so I'm off to solve that one. If anyone has
any ideas on that please shoot them my way.
Thanks!
Sarah
[Non-text portions of this message have been removed]