Hi
I've written the following code for a button on a form to open a mail merge
document in MS Word. The code opens the document fine but does not display
the usual connection details to open the table in my database when the file
is opened.i.e:
"Opening this document will run the following SQL command:
SELECT * FROM 'filename' "
Hence all that is opened is a document with no updated details from the
source table. If I open the document directly in Word it works OK.
-----------------------------------
VBA Code in Access form:
On Error GoTo Err_SettLett_Word_Click
'declare variables
'object variable that refers to Word
Dim appWord As Object
'Word.Application data type established from reference to Word's object
library
Set appWord = CreateObject("Word.Application")
'make Word visible
appWord.Visible = True
'Open Word document
With appWord
.Documents.Add "C:\DD\Database work\GCRE\settlement_lett.doc"
End With
----------------------------------
Any help much appreciated.
Thanks in advance
Dawn
Albert D.Kallal - 30 May 2005 00:18 GMT
It might be your machine settings.
Give my sample word merge a try here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
if the above works for you..then you can look at the code....

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal