swpa_wnt
asked on
Extra spaces in number in Word 2007 merge field
I've set up a Word doc with form fields that will be used to merge numerical data from Excel. By default, the numbers lose their comma when they appear in Word, so I added a switch to the field code. For example: { MERGEFIELD ADJUST \# ##,### }, where ADJUST is the column name in Excel. The use of ##,### tells Word what the maximum number of digits will be in a number, and where to place the comma. For numbers that don't require all those digits, each unnecessary # is replaced with a space. So, for a small number like 200, the mergefield displays "[space][space]200". This would be fine if my numbers were in a table, but these numbers are included in sentences, and the extra spaces are not acceptable. Is there an additional switch I can add to the mergefield code that will replace each unnecessary # with NOTHING instead of a space?
Try "#,##0". This will drop all leading zeros except the last one.
ASKER
Hi, Graham,
Nope, no difference with that change.
Nope, no difference with that change.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry, I guess my question turned into a non-issue after all. If you have no objection, Graham, I'll just delete it.
ASKER
I discovered a code format that worked for my purposes.