Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USING BOOKMARKS IN WORD DOCS

Status
Not open for further replies.

gazza1

Technical User
Nov 2, 2001
7
ES
I have various Bookmarks set in a Word Doc. The Doc is then opened from Access Database using a Command Button and the Bookmarks are replaced with text from fields in my Database. The problem I have is that when I print the Word Doc and close I then wish to perform the same process for another client, however, it fails to perform properly. The Bookmarks appear to have been lost. On pressing the Command Button the Bookmarks are not replaced by the Text in the Database. Can anyone offer any help or solution?

Many thanks.
 
Isn't it easier to make a mail-merge document with your access database, saving the word file as a template (.dot)and make a button in the acces database that opens a new Word-file based on the template?
This worked for me...

Here is the code for the access button:

Private Sub Button1_Click()
On Error GoTo Err_Knop5_Click

Dim appWord As New Word.Application
Dim docWord As Word.Document
Dim strFilePath As String
strFilePath = "c:\mydocs\template.dot" ' fill in the name of the file

Set docWord = appWord.Documents.Add(Template:=strFilePath, NewTemplate:=False)

appWord.Visible = True

appWord.Activate 'Activate Word using the template


Exit_Button1_Click:
Exit Sub

Err_Button1_Click:
MsgBox Err.Description
Resume Exit_Knop5_Click

End Sub

Theo van Netten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top