Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2003
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    I have a client who is trying to achieve the following in Word 2007. They run letter mail merges to insert various information from an Excel spreadsheet. What they want is some sort of trigger, whereby if in the merged document there is a y against the field called, say, legal paragraph, there is a standard block of text related to legal paragraph inserted into the letter. I have tried using the IF, THEN, ELSE field, but this is limited to 255 characters and the paragraphs can sometimes be longer. There can be up to 20 or 30 of these parapraphs so just running separate mail merges won't do.

    I am thinking maybe there could be some way of doing it with Autotext entries and a macro but can't think how.

    Does this make sense? Anybody have a suggestion?

    Thanks

  2. #2
    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 lauriew View Post
    What they want is some sort of trigger, whereby if in the merged document there is a y against the field called, say, legal paragraph, there is a standard block of text related to legal paragraph inserted into the letter. I have tried using the IF, THEN, ELSE field, but this is limited to 255 characters and the paragraphs can sometimes be longer. There can be up to 20 or 30 of these parapraphs so just running separate mail merges won't do.

    I am thinking maybe there could be some way of doing it with Autotext entries and a macro but can't think how.
    Can you combine an IF field with an AUTOTEXT field as the "yes" text? (I assume the AUTOTEXT field carried over to Word 2007, despite the introduction of Building Blocks, but I'm not able to check at the moment.)

  3. #3
    Star Lounger
    Join Date
    Jan 2003
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jscher2000 View Post
    Can you combine an IF field with an AUTOTEXT field as the "yes" text? (I assume the AUTOTEXT field carried over to Word 2007, despite the introduction of Building Blocks, but I'm not able to check at the moment.)
    Blimey, I think that blooming works!! I nested an AUTOTEXT field into the IF field and it actually worked. Fantastic, thanks so much!!

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    An alternative to using an AUTOTEXT field is to embed the output text in a QUOTE field inside the IF field. For example:

    {IF{MERGEFIELD MyField }= 1 {QUOTE "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."} "Who cares what the fox did!!"}

    That way, you can have multiple paragraphs, with different Styles, etc, all controlled by a single IF test. This works because the QUOTE field is treated as a single character by the IF test.
    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
  •