Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post

    Mail Merge Features (2000/2002)

    My company uses the Mail Merge feature of Word to create forms such as leases in which the data comes from our softwares SQL Server/Oracle DB. This is done programatically thru our programs interface. We use a hdr file as the data source. The user builds the Word file entering the merge fields in the appropriate location in the doc and at run-time our program populates the hdr file with real data (at design time it has only one row of info which represents the field names) and then loads the Word doc and starts the mail merge.

    What I'm lookinig for is any neat tricks or features of Mail Merge that I can use in the class we provide our users on how to use Word's Mail Merge with our program. I am very familiar with Excel and VBA but when it comes to Word I know only the basics. An example of something is an equivelent in Word to the Conditional Formatting in Excel. So if a merge field contains $$$ amounts it would be neat if you could set it so that the font changes say to red if the value is either a negative amount or above a certain amount. Anything that can normally be done with Mail merge would be great.

    Thanks
    Ed

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge Features (2000/2002)

    Hi Ed:
    For the specific question, you can format the result using a numbic picture switch. e.g. using 2 bookmarks called bmka & bmkb:
    If you have
    bmka = 20
    bmkb = 40

    Then a field
    { = { REF bmka }-{ REF bmkb } # xx;xx;x } where the curly braces are inserted using Ctrl+F9, not typed. The numeric picture switch will give positive, negative, & zero result formats. Each is separated by a semicolon. If you select & format the second XX with red font, the negative results will be red. See attached.

    You can also make results dependent upon IF fields, which have the syntax:

    {IF Condition Exists "See this result" "Else see this result"}

    It's hard to get more specific, but you could use something like:

    {IF {Mergefield FirstName} = Sally "Hi Sally" "To Whom It may concern" } You can find more about IF fields in the online help index under IF. Post back with any specific questions & we'll be glad to help.
    Hope this helps,
    Attached Files Attached Files

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Mail Merge Features (2000/2002)

    There is also the option of using an IF statement field so you can change text based on some data condition. We have used that extensively in some of the documents we created for one of our clients. And you can nest IF statements, though it gets pretty hairy if you do more than two deep. We also use Word Automation to create documents directly from data in a database - it is often faster and more powerful since you have a full programming language at your disposal. But you certainly don't want to talk about that in a class in mail merges (unless you are trying to drum up development requests).
    Wendell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •