General information
Category:
COM/DCOM and OLE Automation
Hi Tamar,
I appreciate all your help and I'm at my wits end. This is my code in a nutshell:
oWord=CreateObject("Word.Application")
oWordobj="oWord.WordBasic"
WITH &oWordObj
.FileNewDefault()
.
.
Processing
.
.
lcDSN="DSN=Visual FoxPro Tables;DBQ=C:\;DefaultDir=C:\;DriverId=536;UID=admin;"
lcSQL= "SELECT * FROM "+lcData
.MailMergeOpenDataSource(lcData,0,0,1,0,"","",0,"","",lcDSN,lcSQL,"")
.MailMerge(1,0,0,"","",0,1)
.FileSaveAS("abc.doc")
ENDWITH
Thru tracing I found that the value of .MailMergeMainDocumentType defaulted to -1 but then changed after the OpenDataSource statement to 0. Additionally, when I tried to use the code .mailmergetodoc, I got an error that the file has no merge fields in it! But when I try to fax or email to a client they can't open the file because it seems to be connected with the data source! Help. (and Thanks.)
Shuli
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only