FoxPro 2.6 and WinWord

FoxPro 2.6 and WinWord

Post by WILLIAM C » Fri, 08 Nov 1996 04:00:00




: 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)

 
 
 

FoxPro 2.6 and WinWord

Post by Ingo Oeller » Sat, 09 Nov 1996 04:00:00



> 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?

You have to use the OLE-capabilities of FoxPro. (see Developer
documentation)
WinWord should get OLE-Verbs for printing if you call such a FoxPro
Procedure
Quote:> 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).

Winword installs himself into to the OLE-Section in the WIN.INI File.
Some OLE-Actions from Foxpro to WinWord calls Winword automatically
(and looks to be very faster than DDE-Control or a WinExec-Command)

Good Luck
Ingo Oellers

 
 
 

FoxPro 2.6 and WinWord

Post by Sara » Mon, 11 Nov 1996 04:00:00


Watch out with using OLE on a win '95 machine.  causes no end of hassles
mixing 16bit and 32bit OLE.  DDE works well though and might be worth
implementing if you have a cross platform situation.

 
 
 

1. importin FoxPro 2.6 into WinWord 6.0

Is there any work around of this problem:
I want to print address labels using WinWord6.0's mail merge function. But
some of the addresses have these German umlaute. When browsing the database in
FoxPro 2.6 (Windows program!) I see the corrrect umlaute. When importing the
addresses into WinWord for example the IBM PC ASCII letter for the value 246
is displayed (a sign for division) and not the correct ANSI sign for the
umlaut oe.

Thank you!
***********************************************************************
Reinhard Schumacher, M.D.                                  Kinderklinik
Universit?t Mainz                                 Abt. Kinderradiologie
D-55101 Mainz, Deutschland                           Fax: (6131)-176693
***********************************************************************

2. exporter les champs "memo" dépuis paradox

3. FPW 2.6 and Winword 97 under NT

4. select statement

5. FPW 2.6 and RUN WINWORD

6. Stop splitting memo fields to different pages?

7. WTB: Foxbase+, FoxPro 1.0 for Win, FoxPro 2.0 for DOS, FoxPro 2.6 DOS/Win

8. Progress, Opinions solicited.

9. foxpro 2.6 dos to 2.6 unix

10. Help for dde winword / demande d'aide sur dde winword

11. How to Save data in Foxpro 2.6 using Visual Foxpro Driver (ADO)

12. Foxpro 2.5 Dos and Foxpro 2.6 Windows

13. Migrating Graphs from FoxPro 2.6 to Visual FoxPro.