I am using Word 2003 and Access 2003
I still have to run the Macro manually. Once the macro runs there is a
screen that you have to select the data source. I click "Machine Data
Source" then click MS Access Database then OK. Then it prints out as
the macro says.
OK, first thing I'd do is to link this main merge document properly to
the data source. It looks like it currently has an incomplete link via
OLE DB. I always prefer to link using ODBC if at all feasible.
Go into Word and open this document. You can answer "No" to the SQL
question (assuming that pops up).
Activate "Confirm conversions on open" in Tools/Options/General. Use the
command you usually would to link up to the data source. Once you've
selected the *.mdb file you should get a dialog box with connection
methods. Choose ODBC.
In the next dialog box, in order to list the queries, click "Options",
then activate "Views". When you come back to the list, make sure the
correct *.mdb file is still selected, then choose your query.
You shouldn't need the macro in the word file at all. Instead, you can
start mail merge execution from the VB code.
Dim objWord As Object
Dim objDoc as Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Open( _
"x:\technicians\training\rca\RCA_Form_v.1.doc)
objDoc.MailMerge.Execute
'objDoc.Close
ActiveDocument.PrintOut
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail
