Mail Merge in Microsoft Word
the with FileMaker ODBC Driver
Because Microsoft Word for Macintosh (Office
98) does not support ODBC, this technique can only be used on
Windows. Office 98 users will need to use the Office 98/FileMaker®
Pro Data Importer which Microsoft released to provide similar
functionality. In this example we'll look at how to use the ODBC
data driver and FileMaker Pro.
Once you install the ODBC driver, you treat
ODBC data hosting just like any other sharing technology in
FileMaker Pro.
Microsoft Office does not install Microsoft
Query as part of the standard installation, so you'll need to do a
custom install to use this tool. Note that you don't need
Microsoft Query to refresh queried data. To edit a query or create
a new query you'll need to install Microsoft Query.
Windows 95/98 Setup:
-
Open the 32bit ODBC control panel and
define a User DSN for FileMaker Pro.
-
Click the Add button to add a DSN for
FileMaker Pro.
-
FileMaker Pro will appear near the top of
your list. If it's the first item on your list it will
automatically be highlighted for you.
-
Click the Finish button. Give this DSN a
name and description. You only need a single User DSN for all
FileMaker Pro data hosting. I've named mine
"FMP.fp3"
-
Click OK and OK again to finish with the
control panel.
In FileMaker Pro:
-
Select Edit...Preferences...Application
Preferences...Plug-Ins...check Local Data Access Companion to
turn on ODBC hosting for your copy of FileMaker Pro 4.1.
-
Select File...Sharing...check Local Data
Access Companion to turn on hosting for each file.
Just as with Web Companion and Multi-User
file sharing, you can selectively give or deny users access to
each open file on your machine.
Creating a Mail Merge Document using SQL
Query In Microsoft Word:
-
In a new document window, select Tools
menu...Mail Merge. Click Create, and then click Form Letters.
When Word displays a message, click Active Window to create
the form letter in your currently active window.
-
In the Data Source popup menu, select
Create Data Source and then the MS Query button to use the
Query wizard to create your SQL query.
-
In the Choose Data Source dialog, select
the FileMaker Pro DSN you created, and click OK. Note that
this dialog refers to FileMaker Pro as the database; Query
will refer to each open and LDAC-shared file as a table in the
next dialog. You can also save repeat queries and select them
from this dialog by clicking on the Queries tab and selecting
a saved query.
-
The Query Wizard--Choose Columns dialog
comes up. In the left hand side of the window are your
FileMaker Pro files which are both open and LDAC-shared.
Let me emphasize here again that you can have files open yet
choose to only give selective access to files via ODBC, Web
Companion or FileMaker Pro's peer-to-peer file sharing.
-
Click on the plus (+) sign to the left of
the file(s) you want to extract information from to see the
fields in that file.
-
Double-click on fields to include them in
your query. If you want all fields in a database, simply click
on the database name and then on the ">" button,
and all fields will be listed on the right. Note that you can
select fields from multiple files ("tables") to
import into your spreadsheet. Click on the Next button to
continue.
-
Include your find ("filter" or
"where") criteria, if any, and click on Next to
continue.
-
Specify your sort criteria ("order
by"), if any, and click on Next to continue.
-
Save your query if you will be using it
again in the future, and click Finish to return your data to
Microsoft Excel. If you want to massage the query further or
play with the SQL, select the View Data or Edit Query in
Microsoft Query option.
-
If you're starting with a blank document,
you'll get a dialog box indicating so. Click Edit Main
Document to insert merge fields into your document.
-
You are in a blank document and you
should have a mail merge tool bar available now. Type your
document as normal, and click on the Insert Merge Field button
from the tool bar to insert fields as desired.
-
Once you've typed your document, return
to the Mail Merge Helper and select Merge. You can create a
new document, send the merged letters to the printer, or send
the merged letters as emails.
|