Hi Cetin,
Thanks for your reply and sample code. In researching this problem I had already studied some of your previous messages related to Word automation. Your understanding in this area is really quite amazing!
In the end I opted to define the data source (a dbf) for my merge document within the document itself. After executing an SQL statement to create the dbf file, the code below seemed to do the trick:
public oMW
oMW=createobject("word.application")
with oMW
.visible = .f.
.documents.open('c:\nnjvfp\include\nnj violation letter 1.doc')
.activedocument.mailmerge.execute
.application.options.printbackground = .t.
.activedocument.printout(.t.)
do while .application.backgroundprintingstatus > 0
enddo
.activedocument.close(.f.) && close the merge document without saving
.activedocument.close(.f.) && close merge template doc without saving
.quit()
endwith
oMW = ''
Thanks again for your help!
The day you take complete responsibly for yourself, the day you stop making any excuses, thats the day you start to the top. - O.J. Simpson
Great advice from a questionable source...