Solved

Extra spaces in number in Word 2007 merge field

Posted on 2012-03-14
5
371 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:swpa_wnt
[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
  • 4
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37721583
Try "#,##0". This will drop all leading zeros except the last one.
0
 

Author Comment

by:swpa_wnt
ID: 37721666
Hi, Graham,

Nope, no difference with that change.
0
 

Accepted Solution

by:
swpa_wnt earned 0 total points
ID: 37721668
I don't have leading zeros, I have leading spaces.

On edit: Ah, wait, here we go.  Instead of "##,###", I can delete the first two #s but leave the comma, so it is just ",###"  This will work for me, as none of the numbers are less than 3 digits.
0
 

Author Comment

by:swpa_wnt
ID: 37726905
Sorry, I guess my question turned into a non-issue after all. If you have no objection, Graham, I'll just delete it.
0
 

Author Closing Comment

by:swpa_wnt
ID: 37760255
I discovered a code format that worked for my purposes.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

734 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