Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Mail Merge field format with different data types as possible input

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 14-05-2011
Member
 
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?

Reply With Quote
  #2  
Old 14-05-2011
Member
 
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.
Reply With Quote
  #3  
Old 14-05-2011
Member
 
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?}
Reply With Quote
  #4  
Old 14-05-2011
Member
 
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.
Reply With Quote
  #5  
Old 14-05-2011
Member
 
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.
Reply With Quote
  #6  
Old 15-05-2011
Member
 
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.
Reply With Quote
  #7  
Old 19-05-2011
Member
 
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".
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 10:52 AM.