Solved

MS Word 2003 Formatting merged fields

Posted on 2006-06-12
7
1,170 Views
Last Modified: 2016-08-29
Another program ACT! has the abitlity to merge its database fields into a Word template.  The resulting merged document results in all currency fields having no dollar sign nor commas.
The template field directly from the database would be -
<Additional Amt> resulting output - 15000.00
The underlying field code is -
{ DOCVARIABLE [ACTFIELD]TBL_CONTACT.CUST_AdditionalAmt_081859447 \*
MERGEFORMAT }
If I try to add formatting to it as in -
{ DOCVARIABLE [ACTFIELD]TBL_CONTACT.CUST_AdditionalAmt_081859447 \# ###.00
\* MERGEFORMAT }
It results in - <Additional Amt> outputed as plain text in the document.

I just need to get the fields formatted correctly, when pulling them into the template.

Thanks for any help.
0
Comment
Question by:gusevans
  • 3
  • 3
7 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16892075
You can put a dollar sign and add a comma in the numeric switch, e.g. :
\# $#,##0.00

So the whole thing would look like this:

 { DOCVARIABLE  [ACTFIELD]TBL_CONTACT.CUST_AdditionalAmt_081859447 \# $#,##0.00 \* MERGEFORMAT }

I have just tested it with a variable of the same name, and the resulting field is displayed as $15,000.00
0
 
LVL 17

Expert Comment

by:wobbled
ID: 16892224
For further information on this:

If you type the words "format fields" into word help you should see an option for Format (\*) field switch.  This will give you information on how to format the data returned on a field.
0
 

Author Comment

by:gusevans
ID: 16894096
GrahamSkan and wobbled,
I had done both and neither worked.  I have researched all Word Help MS Knowledge Base and Communities.  

When I insert the field in the template in Word using the ACT! addin and then do Alt-F9 to see the field codes, I can see { DOCVARIABLE [ACTFIELD]TBL_CONTACT.CUST_AdditionalAmt_081859447 \* MERGEFORMAT }.  But if I edit it by adding '/# $#,###.00' and then try to use it, it just gives me the field name as text - <Additional Amt>.

I have added over 500 fields to the database and ACT! support says that because it is so large a database it may not work.  They say it is a Microsoft problem not theirs.

Maybe thier is a way to use VBA and bookmarks to fix it???
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16895250
Perhaps we just don't understand the problem. On the face of it, you have a document variable with that long name, and a value of 15000.00.

If that is the case, then the numeric switch should be able to format it.

Can you post the document here: http://www.ee-stuff.com/ so we can see it? Tell us back here in a comment.
0
 

Author Comment

by:gusevans
ID: 16899269
GrahamSkan,

Here is what I got from ee-stuff.com

The field in question is <Additional Amt>.

View all files for Question ID: 21884095
https://filedb.experts-exchange.com/incoming/ee-stuff/205-EE.ziphttps://filedb.experts-exchange.com/incoming/ee-stuff/206-EE2.zip
 

Direct link to your file
https://filedb.experts-exchange.com/incoming/ee-stuff/205-EE.zip 
0
 

Author Comment

by:gusevans
ID: 16899289

Below are links to 2 similar files using the same field in the same database, same contact record in a different template with different results ???

View all files for Question ID: 21884095
https://filedb.experts-exchange.com/incoming/ee-stuff/205-EE.ziphttps://filedb.experts-exchange.com/incoming/ee-stuff/206-EE2.zip
 

Direct link to your file
https://filedb.experts-exchange.com/incoming/ee-stuff/206-EE2.zip 
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points
ID: 16900983
For each example, you have posted two files, a Word document, and a file with an extension of .adt. The latter file is, I suppose, a data file that the third party program uses to run its merge, which does not appear to based on Word's mail merge.

In the word document there is only one Word field - the current date.

The plain text <Additional Amt> is visible.

There are 34 document variables, including these two

             Name                                                                                             Value
[ACTFIELD]TBL_CONTACT.CUST_AdditionalAmt_081859447                           <Additional Amt>
[ACTFIELD]TBL_CONTACT.CUST_AdditionalAmt_081859447 \# #,###.0         [[ACTFIELD DELETE ME]]

I infer that the third party program adds the variables and corresponding DocVariable fields, plugging the default values such as <Additional Amt> with values from its database. It then unlinks all the fields leaving only the data. I guess that it gets confused with the formatting instruction, and cannot match it to its appropriate data base field. It might be trying to include the numeric switch when trying to extract the Document variable name

There is no evidence that it is a Word problem, because that numeric switch works OK normally. Even if it were a Word bug, we cannot analyse the way that the third party program works to have found such a bug.

However, it sounds pretty fundamental to me, so there may be something in their instructions. Document variable names can have spaces in them, so it might be worth enclosing the name with quotes.

{ DOCVARIABLE  "[ACTFIELD]TBL_CONTACT.CUST_AdditionalAmt_081859447" \# $#,##0.00 \* MERGEFORMAT }
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There is a feature provided by MS Word that lets you create an Table of Contents for your Word document automatically. To use this feature for other documents there are two steps involved,   1.  Prepare your document for a table of contents (he…
When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than man…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now