Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change VBA code to VFP code
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00419145
Message ID:
00419154
Views:
26
Hi!

Sequense not enough. There are certain functions that require characters instead of number. When you specify in VB 'Parameter:=5', but parameter should be character type, VB automatically converts it. VFP does not, so you need to do this manually.

>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
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform