RoadRunnerOz
Programmer
I have to keep setting the datasource to my excel file every time I open the file from Visual FoxPro
After setting the datasource I get asked if the First row of data contains column headers
After selecting OK I can the automate to my hearts content
How can I bypass this dialog and/or how can I open the document with the datasource attached?
Thanks
The code:
oWord = Createobject('Word.Application')
oword.setvisible(.T.)
*--lcfilename is a wordmerge doc that is already attached to an excel file
lcfilename = SYS(5)+SYS(2003)+"\templates\mydoc.dot")
oword.Documents.open(lcfilename) && change to .Documents.add and same issue
tcFileName = "c:\temp\mydata.xls"
*-- Above opens file with merge fields but NO datasource!oword.ActiveDocument.MailMerge.OpenDataSource( tcFileName, ;
0, .F.,,.T.,,,,,,,"Entire Spreadsheet" )
*-- opening the file from explorer by double clicking on it opens the file with the datasource!
Michael Ouellette
After setting the datasource I get asked if the First row of data contains column headers
After selecting OK I can the automate to my hearts content
How can I bypass this dialog and/or how can I open the document with the datasource attached?
Thanks
The code:
oWord = Createobject('Word.Application')
oword.setvisible(.T.)
*--lcfilename is a wordmerge doc that is already attached to an excel file
lcfilename = SYS(5)+SYS(2003)+"\templates\mydoc.dot")
oword.Documents.open(lcfilename) && change to .Documents.add and same issue
tcFileName = "c:\temp\mydata.xls"
*-- Above opens file with merge fields but NO datasource!oword.ActiveDocument.MailMerge.OpenDataSource( tcFileName, ;
0, .F.,,.T.,,,,,,,"Entire Spreadsheet" )
*-- opening the file from explorer by double clicking on it opens the file with the datasource!
Michael Ouellette