none
Want to show only first word in mail merge RRS feed

  • Question

  • Hi every one!
    I am looking for a solution to display only first letter of a word in mail merge.

    Example 1
    Input: Shun
    Output: S
    Example 2
    Input: Alex
    Output: A

    Please share Toggle field code if any one has.
    Any help will be highly appropriated

    Regards
    Shun
    Monday, May 6, 2013 7:53 AM

Answers

  • Assuming you're only working with capitals for the first letter:

    {QUOTE{SET Data {MERGEFIELD MyField}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}}


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, May 6, 2013 8:09 AM
  • All you need to do is to change:
    {MERGEFIELD MyField}
    in the field code I posted to:
    {MERGEFIELD Applicant_Name \* FirstCap}

    Note: The field brace pairs (ie '{ }') for the above examples are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from the messages. In any event, the field code I posted is little more than a series of 26 fields coded as:
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    Simply create one such field and paste it 26 times, just before the right-most field brace, in the all-encompassing:
    {QUOTE{SET Data {MERGEFIELD Applicant_Name \* FirstCap}}}


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, May 6, 2013 9:19 AM
  • String manipulation is not easy in Word. If the data source for your mail merge is an Excel worksheet or an Access table/query, you could add a calculated column that returns the first letter of another column. You can then use this in your mail merge.

    Regards, Hans Vogelaar

    • Marked as answer by CRMGeek1 Monday, May 6, 2013 12:57 PM
    Monday, May 6, 2013 8:03 AM

All replies

  • String manipulation is not easy in Word. If the data source for your mail merge is an Excel worksheet or an Access table/query, you could add a calculated column that returns the first letter of another column. You can then use this in your mail merge.

    Regards, Hans Vogelaar

    • Marked as answer by CRMGeek1 Monday, May 6, 2013 12:57 PM
    Monday, May 6, 2013 8:03 AM
  • Assuming you're only working with capitals for the first letter:

    {QUOTE{SET Data {MERGEFIELD MyField}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}}


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, May 6, 2013 8:09 AM
  • Hi Paul Edstein
    Is there any option to use left function in this case if yes please let me know
    Here is the syntax that i am using in my mail merge.

    { MERGEFIELD  Applicant_Name \* FirstCap }

    Could you please give me the proper syntax that i could use

    I am using text file as an input that comes with CRM mail merge function.

    Regards
    Shun


    • Edited by CRMGeek1 Monday, May 6, 2013 8:28 AM
    Monday, May 6, 2013 8:25 AM
  • All you need to do is to change:
    {MERGEFIELD MyField}
    in the field code I posted to:
    {MERGEFIELD Applicant_Name \* FirstCap}

    Note: The field brace pairs (ie '{ }') for the above examples are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from the messages. In any event, the field code I posted is little more than a series of 26 fields coded as:
    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}
    Simply create one such field and paste it 26 times, just before the right-most field brace, in the all-encompassing:
    {QUOTE{SET Data {MERGEFIELD Applicant_Name \* FirstCap}}}


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, May 6, 2013 9:19 AM
  • Hi Macropod,
    Thanks for your time. Could you please write the complete code so just i can use it in my template because i am really new to templates.
    I am doing this in following manner but getting nothing

    {{QUOTE{SET Data {MERGEFIELD Applicant_Name \* FirstCap}}}

    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}

    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}

    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}

    {IF{REF Data}= "{SEQ Ltr \* ALPHABETIC}*" {SEQ Ltr \c \* ALPHABETIC}}

    .

    .

    .

    26 times

    }It display's me nothing.

    Regards
    Shun

    Monday, May 6, 2013 10:58 AM
  • I have already provided the complete code in the only form it can be posted here - as text. Did you create all the field brace pairs (i.e. { }) via Ctrl-F9? For a macro to convert the textual representation to a working field code, see: http://www.gmayor.com/export_field.htm#TextToField

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, May 6, 2013 11:04 AM