Mail Merge Sort Problems

T

Trousers

I am mail merging from a third party application into Word and have a
problem when trying to sort into numerical order.

The Field <<Unique_Code>> consists of a reference in the format 1124/X
where X is a sub code of anything from 1 to 10. When trying to sort
these numerically Word seems to treat the "/" as a division sign and
takes action accordingly therefore 1124/2 will appear in the 562nd
position on the list rather than immediately following 1124/1

Anyone know of a way round this please?
 
C

Cindy M -WordMVP-

Hi Trousers,
I am mail merging from a third party application into Word and have a
problem when trying to sort into numerical order.

The Field <<Unique_Code>> consists of a reference in the format 1124/X
where X is a sub code of anything from 1 to 10. When trying to sort
these numerically Word seems to treat the "/" as a division sign and
takes action accordingly therefore 1124/2 will appear in the 562nd
position on the list rather than immediately following 1124/1
This is correct. Word is "nasty" about this kind of thing, I'm afraid.
About all I can suggest is to first bring the data into a different
format, so that you can pre-sort.

1. Bring it into Excel

2. Create a CATLOG type of mail merge in Word, with a one-row table, one
column for each field. Execute the merge to a new document, and you
should wind up with a table of data. Save this as a Word document, sort
it (you should be able to specify a text sort), and use it as the data
source.

3. The other thing you can try, although it's not certain it will work,
is to sort in the SQL, outside the Word UI, using VBA. Whether this can
work will depend on what the data source supports, but most do support
sorting. Try recording setting the Sort in a macro. Then try running the
macro and see if that gives you a different result.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
T

Trousers

Augusta, Georgia late September, one Cindy M -WordMVP-'s hot tempered..

This is correct. Word is "nasty" about this kind of thing, I'm afraid.
About all I can suggest is to first bring the data into a different
format, so that you can pre-sort.

1. Bring it into Excel

Yeah I feared as much - am tinkering with it in Excel now.

Many thanks for your help.
 
F

Francis Dion

Hi,

Your problem is that Word treats your string as a number. One easy way
out might be to have both the field itself and an expression like "x"
& [field] included in your merge.

You use the field itself in the document but you instruct Word to sort
on the ("x" & [field]) expression, thus making sure it cannot be
misinterpreted as a number.

Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top