: Q1) Can I print the document from FoxPro? In other words, can the
: operator enter the data in a data entry screen, press a Print button, and
: have the merge take place and have the output printed directly without
: going to Word and doing the merge/print from Word?
yes
: Q2) Can I store the document in a FoxPro data table (general field) and
: perform the merge/print from the document template in the FoxPro table? (I
: realize need the WinWord application needs to be accessible to the user).
yes
: Q3) If Q2 is a yes, do I need to store 2 templates for each document; one
: for Win31 and another for Win95 or can the Win95 template use a Word 6.0
: document without a translation.
yes
: Q4) I know this is a lot, but could you provide some sample code? To keep
: it simple perhaps just merging a name into a Word document with the name
: coming from FoxPro.
yes...er...I mean here's something I'm using:
&& Where Word is located
wordprogram = "C:\MSOFFICE\WINWORD\WINWORD.EXE"
&& Open Word & DDE channel to
= DDESetOption("SAFETY", .F.)
channel = DDEInitiate(wordprogram, "")
IF channel = -1 THEN
RUN /N &program
DO WHILE channel = -1
channel = DDEInitiate(wordprogram, "")
ENDDO
ENDIF
= DDEExecute(channel, "[AppMinimize]"
&& Open document
= DDEExecute(channel, '[FileOpen "'+ your_template +'"]')
&& Perform search and replace
= DDEExecute(channel,;
'[EditReplace .Find="'+ template_token +;
'", .Replace="'+ some_token_value +;
'", .MatchCase=0, .ReplaceAll]')
&& Print & Exit
= DDEExecute(channel, '[FilePrint]')
= DDEExecute(channel, '[FileExit]')
= DDETerminate(channel)
2. Backup sql
3. Opening a Foxpro 2.6 database using VB 6.0
4. Variable Declaration Simplification
5. Translating Foxpro 2.6 or VFP 6.0 from English to Spanish
7. FPW 2.6 and Winword 97 under NT
8. text functions; compositing many varchar's to a text-type
10. WTB: Foxbase+, FoxPro 1.0 for Win, FoxPro 2.0 for DOS, FoxPro 2.6 DOS/Win
11. DDE and Winword 6.0 (FPW26- German)
12. foxpro 2.6 dos to 2.6 unix
13. Help for dde winword / demande d'aide sur dde winword