Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    conditional mail merge - skipping line if field is blank

    Hi,

    sorry if this has already been answered but I cant find anything and it is getting late.

    I have a line in a mail merge document which I only want to show if a merge field on the line is not blank.
    ie:



    the condition is "if hoursworked =0 print "" else print "<Name> has worked <hoursworked \# 0.0> hours at <rate \# 00.00> per hour"

    seems it should be easy but I cant get it to work correctly nd any help would be much appreciated.

    John

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi John,

    You can do this with a field coded as:
    {IF{MERGEFIELD hoursworked}<> 0 "{MERGEFIELD Name} has worked {MERGEFIELD hoursworked \# 0.0} hours at {MERGEFIELD rate \# 00.00} per hour"}
    Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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