Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change VBA code to VFP code
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Change VBA code to VFP code
Miscellaneous
Thread ID:
00419145
Message ID:
00419145
Views:
49
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
Map
View

Click here to load this message in the networking platform