Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jun 2008
    Location
    Baltimore, Maryland, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    'BEGINS WITH' Operator for Field Code Expressions (2003 / 2007)

    Here is a relatively simple question. Is there a character that can be used as an operator in Mail Merge code that means "BEGINS WITH" ? It would have the same effect as a similarly-named search criteria option in a software program.

    Example: { IF { = { IF { MERGEFIELD 32 ) BEGINS_WITH “Woody’s” 1 0 } } > 0 "Woody's Lounge" "" }

    If field 32 contained the text "Woody's", "Woody's Lounge", or "Woody's Lounge Act", "Woody's Lounge" would print on the document. If field 32 contained the text "Woody" (and nothing else, nothing would print on the document.

    I did some research, but did not find anything that would work in Word.

    Thank you.

    Kevin

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

    Re: 'BEGINS WITH' Operator for Field Code Expressions (2003 / 2007)

    Hi Kevin,

    You can use wildacrds. For example:
    {IF{MERGEFIELD 32 * UPPER}= "WOODY'S*" 1 0}
    to return '1' for all fields beginning with 'Woody's' or WOODY'S', in any upper/lower case combination.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    Star Lounger
    Join Date
    Jun 2008
    Location
    Baltimore, Maryland, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'BEGINS WITH' Operator for Field Code Expressions (2003 / 2007)

    Yep. That did it. I had to move the second asterisk out side (to the right) of the quote - "WOODY'S"*.

    Another obstacle eliminated. Thank you, once again.

    Kevin

Posting Permissions

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