Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Word 2003 Formatting merged fields

Posted on 2006-06-12
7
Medium Priority
?
1,210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
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 1000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Suggested Courses

604 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