Solved

MS Word 2003 Formatting merged fields

Posted on 2006-06-12
7
1,166 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
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.

744 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

9 Experts available now in Live!

Get 1:1 Help Now