Results 1 to 7 of 7

Thread: Mail Merge field format with different data types as possible input

  1. #1
    Join Date
    Jan 2011
    Posts
    101

    Mail Merge field format with different data types as possible input

    I am putting together a template utilizing mail merge. This is the former time that I have prepared wide use of the mail merge feature, so I am at a standstill learning how to format the fields. If I put in the field into the Word document by no formatting, it illustrates the text values properly but exhibits the percentages as decimals, for example 0.900000000000000. If I utilize switches to format the percentages, the percentages exhibit properly, but a syntax error is caused if the field encloses one of the text options: {= {MERGEFIELD "DoctorOfficeUS”} *100 \# "##0 %”}. Is there anyone here who has any idea or any solution for this?

  2. #2
    Join Date
    Nov 2008
    Posts
    1,259

    Re: Mail Merge field format with different data types as possible input

    You can just try:

    Code:
    { IF { MERGEFIELD "DoctorOfficeUS" } < 2 "{ ={ Mergefield DoctorOfficeUS } * 100 \#0% }" "{ Mergefield DoctorOfficeUS }  }
    All the pairs of { } have to be the unique field code character which you can put in by means of ctrl-F9. If the primary 8 data rows of your sheet all occur to have numeric (i.e. 100%, 90%, 80%) rates the texts will arrive through as "0" and you will either have to fix the sheet anyhow, connect using DDE in its place of OLE DB, or obtain the data using another technique.

  3. #3
    Join Date
    Nov 2008
    Posts
    1,185

    Re: Mail Merge field format with different data types as possible input

    Occasionally while preparing a mail merge document, you may hope to insert text based upon whether a value has been added in one of a number of fields. The below instance tests for whether Field1 contains "A", or Field2 contains "B", or Field3 contains "C". If any or all of those fields gather the state, "True" is stated in the merge document. If not, "False" is entered. In a genuine merge state True or False can be restored by anything you wish.

    Code:
    { if{ =({ Mergefield field1 } = “A” 10} + { if { Mergefield field2 } = “B” 10} + { if{ Mergefield field3} = “C” 10}) } > =1 “True” “False”}

  4. #4
    Join Date
    Nov 2008
    Posts
    1,221

    Re: Mail Merge field format with different data types as possible input

    I think I see what you are attempting to perform, but I am at a standstill getting a syntax error. Is there a “ missing in the code you posted. I notice a total of seven- shouldn't there be 8? I just corrected it as such:

    Code:
    { IF { MERGEFIELD "DoctorOfficeUS" } <> "Standard*" "{ ={MERGEFIELD "DoctorOfficeUS" } * 100 \# 0% }"{ " MERGEFIELD "DoctorOfficeUS" }" }
    This is at a standstill giving me a Syntax error while I choose one of the text choices as the input. The percentages exhibit properly.

  5. #5
    Join Date
    Nov 2008
    Posts
    1,022

    Re: Mail Merge field format with different data types as possible input

    Here I just wish to add something in this case. I have another approach for you:
    Code:
    {IF {MERGEFIELD "DoctorOfficeUS"} = {= {Mergefield DoctorOfficeUS}} {= {Mergefield DoctorOfficeUS}*100 \# 0%} {Mergefield DoctorOfficeUS}}
    On the whole, this tests whether the merge field’s contents is a number. If it is, the number is expressed as a percentage; or else its output as text. As such, it's self-sufficient of both the value of the number and the content of the text.

  6. #6
    Join Date
    May 2008
    Posts
    860

    Re: Mail Merge field format with different data types as possible input

    Yes, the cause I selected for the approach I did was because
    1. it's quite simple
    2. it works for the trouble as precise
    3. it's extensible to all additional percentages between 0 and 100 and to a variety of texts devoid of having to do additional text comparisons.


    The trouble with utilizing { = } on a text expression is that even though the syntax error is efficiently hidden in the output by the truth that the comparison will (generally) be unsuccessful, while you actually merge you at a standstill obtain the syntax errors in pop-up messages except you take steps to hold back them. That would as well occur in my approach if the "text" values enclose a number below 2.

  7. #7
    Join Date
    May 2008
    Posts
    913

    Re: Mail Merge field format with different data types as possible input

    For fields which might enclose zip codes like '1000-999', a test like:

    Code:
    {IF {MERGEFIELD "myField"} = {= {Mergefield myField}} "True" "False"}
    Would assess to False, so you would at a standstill be capable to treat it as text (or do the zip-code processing as per the posts I think you are referring to). And, opposing to what you believe, the creation does not fabricate "syntax errors in pop-up messages", so it is not essential to "take steps to hold back them".

Similar Threads

  1. How to disable the input types on Google Chrome 16
    By Anush21 in forum Technology & Internet
    Replies: 3
    Last Post: 25-12-2011, 06:14 PM
  2. Various Types Of Input Languages Used in Nokia C7-00
    By dinkster in forum Portable Devices
    Replies: 3
    Last Post: 15-02-2011, 12:55 AM
  3. Merge Mail with Windows live mail
    By Mainstream in forum Technology & Internet
    Replies: 5
    Last Post: 08-11-2010, 07:45 PM
  4. Ms Project 2007 Export And Data Field Format
    By edwormald in forum Windows Software
    Replies: 1
    Last Post: 01-05-2010, 05:36 PM
  5. word mail merge "file format"
    By Benigno in forum Windows Software
    Replies: 2
    Last Post: 24-06-2009, 01:41 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,165,842.91547 seconds with 16 queries