How to Modify DDEWORD.SCX to Run with Word 6.0Last reviewed: April 30, 1996Article ID: Q113923 |
The information in this article applies to:
SUMMARYThe dynamic data exchange (DDE) samples (located in the SAMPLES\DDE directory) in FoxPro 2.6 are unchanged from those that shipped with FoxPro 2.5 for Windows. The DDEWORD.SCX sample will not run with Word 6.0 because the Word 2.0 command "FilePrintMergeToDoc" has been replaced in Word 6.0 with "MailMergeToDoc". The error "Unknown Command, Subroutine, or Function" will occur. This article explains how to modify DDEWORD.SCX so that it will work with Word 6.0.
MORE INFORMATIONTo use the DDEWORD.SCX sample with Word 6.0, change the VALID clause of the iChoice push button to contain the following code:
DO CASE CASE iChoice = 1 && Next record SKIP 1 IF EOF() GO TOP ENDIF CASE iChoice = 2 && Previous record SKIP -1 CASE iChoice = 3 && Print merge this record DELETE FILE "mergelst.dbf" COPY NEXT 1 FIELDS client_id, company, contact, address, city, ; state, zip TO "mergelst.dbf" iChannel = DDEInitiate("WinWord", "System") = DDEExecute(iChannel, "[AppMaximize]") = DDEExecute(iChannel, ; '[FileOpen "c:\foxprow\sample\dde\letter.doc"]') = DDEExecute(iChannel, "[FilePrintMergeToDoc]") && This is the *line that changed. = DDEExecute(iChannel, "[MailMergeToDoc]") = DDEExecute(iChannel, "[File1]") = DDEExecute(iChannel, "[FileClose 2]") = DDEExecute(iChannel, "[FilePrintPreview 1]") = DDETerminate(iChannel) CASE iChoice = 4 && Quit CLEAR READ ENDCASE SHOW GETSBesides changing FilePrintMergeToDoc to MailMergeToDoc, you must also convert LETTER.DOC from a Word 2.0 document to a Word 6.0 Mail Merge document. Once these steps are followed, the DDEWORD screen program should function properly.
Steps to Convert LETTER.DOC to a Word 6.0 Mail Merge Document
|
Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |