4 Replies Latest reply on Mar 10, 2013 11:39 PM by pgageler

    FileMaker Info to MS Word?

    ac

      Title

      FileMaker Info to MS Word?

      Post

      I am running FileMaker Pro and Word on a MacBook Pro.  I have a database of client information in FileMaker.  In Word I have legal documents that are generic except for customized fields such as first name, last name, etc.  Instead of filling this information out manually I would prefer to have Word pull it over from FileMaker.  Is there a way to do this?

       

      Thank you in advance.

        • 1. Re: FileMaker Info to MS Word?
          philmodjunk

          Haven't tried this in years, but there's a special export file format, Merge, that was specifically designed to use with Mail Merge in Microsoft Word. You'll need to research this for yourself to figure out the details on the MS Word side, but it should still be possible to do.

          • 2. Re: FileMaker Info to MS Word?
            pgageler

            I have done this on a number of reasonably complex HR solutions - in one case for producing Letters of Offer (4000+ letters a year), in another for Annual Salary Review Advices (around 4,500 letters on a few hours).

            The process is fairly simple - write a script that:

            1. Finds the records you want to use the data from in a word document (where you are producing a document for the current record only, the script will need to isolate the current record, so that only its data is used)
            2. Exports the data (the fields you want) as a .mer file (although you can use .doc in the save name.
            3. Calls the Master/Merge document in MS Word (which used the exported file as it's data source) using the SendEvent Script Step

            I have found that, where there is heavy logic to be applied in the letter (that is, the text needs to be constructed differently based on certain fields), it is much easier to do this in FileMaker itself (calculated fields, where the result is text) than in Word. So you may end up exporting wholly constructed sentences/paragraphs in the second step above.

            Also, if you know someone who is clever with visual basic, you can have a macro run in Word that automatically saves the resultant document, using one or more of the exported fields.

            I hope this helps.

             

            • 3. Re: FileMaker Info to MS Word?
              EzShaffren

                    

                   

                        The process is fairly simple - write a script that:

                   
                          
              1.                Finds the records you want to use the data from in a word document (where you are producing a document for the current record only, the script will need to isolate the current record, so that only its data is used)
              2.           
              3.                Exports the data (the fields you want) as a .mer file (although you can use .doc in the save name.
              4.           
              5.                Calls the Master/Merge document in MS Word (which used the exported file as it's data source) using the SendEvent Script Step
              6.      
                   

                        I have found that, where there is heavy logic to be applied in the letter (that is, the text needs to be constructed differently based on certain fields), it is much easier to do this in FileMaker itself (calculated fields, where the result is text) than in Word. So you may end up exporting wholly constructed sentences/paragraphs in the second step above.

                   I am looking to do exactly that.  I am fairly new at scripting and I don't know how to write a script that exports the fields I want as a .mer file, and then calls the master/merge document and inserts the fields into the pre-written word document.  Once the word document pops up with the fields, I don't care if it isn't save.  The user will make final corrections and save by him/herself.  I just need it to export the relevant fields into the correct places in the Word document.

                   If anyone knows how to write such a script, PLEASE help.  Thank you in advance.

              • 4. Re: FileMaker Info to MS Word?
                pgageler

                     My apologies for taking so long to respond.

                     Here is a basic script to export data from FileMaker and then have MS Word is use that data in a Mail Merge:

                     New Window [ Style: Document ; Close: “Yes” ; Minimize: “Yes” ; Maximize: “Yes” ; Zoom Control Area: “Yes” ; Resize: “Yes” ]
                     Show All Records
                     Omit Record
                     Show Omitted Only
                     Export Records [ File Name: “filewin://FULLFOLDERPATH/Letter of Offer Merge Data.doc” ; Character Set: “Windows (ANSI)” ]
                     Send Event [ open document/application ; File Name: “filewin://FULLFOLDERPATH/Letter of Offer.doc” ]
                     [ Bring application to foreground ]

                     The first four steps exist only to ensure that: (1) data for the current record only is exported, and (2) to not interfere with the user's current found set.

                     The script assumes you have in fact created a Merge document (in my case called "Letter of Offer.doc", that is stored in a location referenced.

                     In setting that up the first time, you will have first needed to have exported the data file in the exact same format as it is in the final script. So I would suggest setting up the export (.mer format, but saving with .doc extension in the name) and then add the last "Send Event" step to the script as a last thing.

                     To ensure your master document doesn't accidently get modified and written over, I would suggest (after making sure everything works as required), setting the properties of that file to "read only" in the operating system.

                     Hope this helps.