locked
Mail Merge with Autotext RRS feed

  • Question

  • Group,

    I am moving from an Office 2003 environment to an Office 2010 environment and have a couple of questions:

    1)Is the 2003 autotext just a rename to "building blocks" in 2010? 

    2) Is it possible to create a mail merge form that allows a user to enter an "auto text entry code", and then during  the merge process, it will insert the text that corresponds to the "auto text entry code".  Example, I have created an autotext entry "gd" for "this is a good day" and "bd" for "this is a bad day".  When the mail merge runs, the letter should either produce "this is a good day" or "this is a bad day" all depending on which code was entered in the mail merge form, "gd" or "bd". 

    I have tried some coding as this:

    {if {mergefield DAYTYPE} = "gd" "{autotext "gd"}"}

    {if {mergefield DAYTYPE} = "bd" "{autotext "bd"}"}

    My results are either "this is a good day", or blank, no day at all.  I can't never seem to have "this is a bad day".

    Any suggestions or "how to" links would be appreciated!

    Diane

     

     

     

    Monday, March 28, 2011 8:01 PM

Answers

  • Hi Diane,

    Whether you're using autotext entries or hard-coded strings in the IF tests, you'll still need to cater for all 12 options. In my testing, it seems you could use:
    {AUTOTEXT {IF{Mergefield Course}= wb wb {IF{Mergefield Course}= pc pc {IF{Mergefield Course}= ms ms {IF{Mergefield Course}= ch ch {IF{Mergefield Course}= xx xx }}}}}}

    Note: You will need to cater for 'missing' courses.


    Cheers
    Paul Edstein
    [MS MVP - Word]
    • Marked as answer by David Wolters Friday, April 1, 2011 2:10 PM
    Wednesday, March 30, 2011 2:24 AM

All replies

  • Hi Diane,

    Assuming you're calling the autotexts correctly, the combined effect of the two fields should produce the desired output. What do you get with {autotext "gd"} and {autotext "bd"} on their own?

    Also, if the only possibilities are '' and '', you could use a field coded as {IF{MERGEFIELD DAYTYPE}= gd {autotext "gd"} {autotext "bd"}}


    Cheers
    Paul Edstein
    [MS MVP - Word]
    Tuesday, March 29, 2011 8:15 AM
  • Paul,

    I have this working - not like I wanted, I finally had to "hard code" my text, which I really hate to do:

    {If {Mergefield Course}= "wb" "We believe......."

    {If {Mergefiled Course}= "pc" "The privilege of......"

    {If {Mergefield Course}= "ms" "The most of......"

    {If {Mergefield Course} = "ch" "The colorful way...."}}}}

    FOR 12 options, this gets really ugly, but it works.  I really want to insert the text stored in my "autotext" based on the course code.....something like this   {autotext {mergefield Course} \* Mergeformat} results in "We believe....." over and over again, it does not change based on the code for each record in my data source.

    Should this be possible? 

    Thanks,

    Diane

    Tuesday, March 29, 2011 9:20 PM
  • Hi Diane,

    Whether you're using autotext entries or hard-coded strings in the IF tests, you'll still need to cater for all 12 options. In my testing, it seems you could use:
    {AUTOTEXT {IF{Mergefield Course}= wb wb {IF{Mergefield Course}= pc pc {IF{Mergefield Course}= ms ms {IF{Mergefield Course}= ch ch {IF{Mergefield Course}= xx xx }}}}}}

    Note: You will need to cater for 'missing' courses.


    Cheers
    Paul Edstein
    [MS MVP - Word]
    • Marked as answer by David Wolters Friday, April 1, 2011 2:10 PM
    Wednesday, March 30, 2011 2:24 AM
  • Paul,

    Just a note to say.... it's working!!  When I tested your example and seen that it worked without the hard coded strings, I decided to try the variable "INCLUDETEXT with a bookmark" instead of "AUTOTEXT".  Advantages are twofold - 1) the users now have control of the text by adding their own bookmarks  2)and by using {includetext "c:\\data......" {mergefield Course}}, it works with the datasource at the merge.

    Your example kept me thinking and all the hard coded text is gone!

    Many thanks for your reply!!

    Diane

     

     

      

    Thursday, March 31, 2011 7:35 PM