Mailmerging in Microsoft Word with FlexOLE

How it works.
First of all, you must have FlexOLE and Microsoft Office 97 installed on your system.

Copy the .Doc Word document files to the Order entry example folder vdf6\examples\order\Data.
Copy the remaining files to the AppSrc directory.

Start the IDE in the order entry workspace
Select 'Register external component' from the 'Components'-menu and select the custmm1.vw file to register. Repeat this for the custmm2.vw file.
Include the Word8 and FlexOLE packages in your main program.

Object ProgramWorkspace is a Workspace
  Set WorkspaceName to CURRENT$WORKSPACE
  Set ModuleName to 'Order'
  Set HelpName to 'OrdEntry.hlp'
End_Object

Use Help_Ids.inc // Developer should provide this file of help context links.
Use Std_Help.pkg
Use FlexOLE.pkg
Use Word8.pkg


Add the new views to your program
Compile the Order Entry sample application.


Mailmerge example 1:

Open a new Word document.
Select Mail Merge from the Tools pull-down menu.
Select Form Letter from the Create pull-down and select the Active Window as the Main document.
Select Open Data Source from the Get Data pull-down menu. Open file CustMnDs.doc in the Data directory.
Create your letter inserting data fields as needed. (See the two example main documents provided.

Dan Walsh

Mailmerge example 2:

My heartfelt thanks to Dan Walsh, who pioneered the creating of this prototype late in 1998 when most of us had'nt even thought about it !
Dan's "Custmm1.vw" code has been enhanced so that:

1. It now automatically prints 2 letters - I needed to test this capability, and did so in rather a lazy manner, but it works and so I will now be writing a front-end capable of selecting database records that meet some pre-determined qualifying specifications.
2. Word8 / Ms Word97 now automatically CLOSES when the job has been sent to the printer.
This was one of the requirements I needed to achieve - no use leaving an active App's window on-screen when it had done what I  needed it to do.

Thanks to Dave Robinson for pointing me in the right direction on this one.

3. All amendments carry "D Walsh" or "P Tawse" so if you are lookig for the alterations, search for either of these Tags.

My thanks also to those others who contributed assistance when I needed it most - much appreciated.

The VDF-GUIdance philosophy certainly makes life MUCH easier and more enjoyable

Peter Tawse
Microbase Software
MELBOURNE, AUSTRALIA

email: ptawse@tbsa.com.au



Notes:
Be sure that you use the supplied version of the Word8.pkg file as this contains some fixes to known problems. The changed list of methods is: