General information
Category:
COM/DCOM and OLE Automation
Title:
Change VBA code to VFP code
Hi.
I/m trying to use OLE automation to get VFP to run a Word Mailmerge . I have turned macro on, and got the commands to run my Mailmerge, but it is in VBA code. An example :
ActiveDocument.MailMerge.OpenDataSource Name:="C:\KER\kfsma.dbf", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"DSN=FoxPro Files - Word;UID=;PWD=;SourceDB=C:\KER;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=MACHINE;Null=Yes;Deleted=Yes;" _
, SQLStatement:="SELECT * FROM kfsma.dbf", SQLStatement1:=""
Now I've replaced the _ with a ; and also bracketed all the parameters, but am getting an OLE Error Code - Type Mismatch)
I have checked the VBA help file and put in the parametes above in the sequence they are specified. I have also tried .T. for any a parameter where :=TRUE.
Any help appreciated
regards,
Gerard
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