Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Oct 2002
    Location
    Mornington Peninsula
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi all,

    Mail Merge Data Source
    Have an excel file with headings in Row 1.
    All records in following rows contain simply 0's and 1's imported from .csv files (resulting from "save data only from forms" from Word users)

    Mail Merge Main document
    Have inserted fields into required locations through out Main Doc, ( which appear as a list one below the other)
    The merge works fine but ....

    TWO PROBLEMS
    I don't want 0's and 1's to appear in the main doc, If there is a "1" (meaning yes to that question in the form) I want to insert the label from the Heading in Row 1 of my excel Data Source file; and
    If there is a 0, I don't want to leave a blank space showing in the Main letter, instead I want to skip the field.

    Normally in mail merge, I know that if there is no result in a field, ie. no company name in an address layout; the result is blank and the next field, ie. address line, moves up. I have played around with the merge fields if...then... else and can get the headings to show up, but if the result is "0" it still leaves the blank row in my letter in the list.

    Your advice would be greatly appreciated. Thank you.
    [attachment=88229:testMain.docx][attachment=88228:testData.xlsx]
    Attached Files Attached Files
    Many thanks for any help, much appreciated.
    Have a great day!
    WebMistress

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    If this is a "one-time" project, then I would simply edit the Excel workbook and replace the 1's in each column by the label in Row 1, and replace the zeros by an empty cell. However if it is an ongoing process that needs to be repeated on a regular basis, then I would modify your main document to use an IF field. The result would look something like this:
    { IF { MERGEFIELD Accounts_Payable } = 1 "Accounts Payable" "" }
    To insert that statememt, on the Mailings tab on the Ribbon, click the Rules drop-down and choose IF - Word will do the rest. Let us know if you get stuck.
    Wendell

  3. #3
    Lounger
    Join Date
    Oct 2002
    Location
    Mornington Peninsula
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi WendellB,
    Many thanks for your suggestion and I have used your code with some success. Unfortunately, if the result is "0" or in otherwords does not equal "1", there is still a blank paragraph marker outside the field brackets, which therefore leaves a blank line on the page. ie:

    Accounts Payable

    Banking
    Payroll


    There is a field in between accounts payable & banking, and one after Payroll.

    I have tried the skip if, but can't seem to make that work? the blank paragraph is still showing?

    Thanks for your time.
    WebMistress
    Many thanks for any help, much appreciated.
    Have a great day!
    WebMistress

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by webmistress View Post
    Unfortunately, if the result is "0" or in otherwords does not equal "1", there is still a blank paragraph marker outside the field brackets, which therefore leaves a blank line on the page.
    Try this: place the line breaks inside the field code, and have no spaces at all between the end (closing curly brace) of one {IF} and the beginning (opening curly brace) of the next.

Posting Permissions

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