Merge with Word from Access

R

Rocky

I have created a Word Merge Document that looks at a table in Access.
The table is created from a make table querie, based on the client id
on the form I have open. I then created a command button to open the
merge document, using the foillowing code:

Function Merge_Contract()

Dim LWordDoc As String
Dim oApp As Object

'Path to the word document
LWordDoc = "C:\WFFG Database\Merge Contract.doc"

If Dir(LWordDoc) = "" Then
MsgBox "Document not found."

Else
'Create an instance of MS Word
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True

'Open the Document
oApp.Documents.Open filename:=LWordDoc
End If

End Function

The proble ois that when I open the document, it loses its links and I
have to start the mail merge process all over again
 

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