Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mailmerge french/english number formatting

1,507 views
Skip to first unread message

Paul Lister

unread,
Jan 31, 2003, 5:56:29 PM1/31/03
to
Hi,

I have been trying to change the number formatting for a
mail merge field. I need both English formatting
(###,###.##) and French formatting (###.###,##). The
problem is that I need both in the same document and I
keep getting the English formatting even if I give
it /# "#.0,00". What I get is a number formatted like
this, 999,999. 999. Is it possible to have multi-language
number formatting on merge fields in one document ? If so
how. If its not possible I can change the code that
creates the data but I'm hoping to do the formatting in
the document s I may need to display the same numbers in
both formats.

Graham Mayor

unread,
Feb 1, 2003, 3:42:18 AM2/1/03
to
The display of numbers is governed to a large extent by the number format
set in Windows regional settings. I think you will be hard pressed to get
Word to adopt both number formats in the same document.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail gma...@mvps.org
Web site www.gmayor.dsl.pipex.com
Word MVP web site www.mvps.org/word

Cindy Meister -WordMVP-

unread,
Feb 1, 2003, 6:35:13 AM2/1/03
to
Hi Paul,

I agree with Graham's assessment. What's your data source?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 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 :-)

Paul Lister

unread,
Feb 3, 2003, 5:04:26 PM2/3/03
to
The data source is a comma delimited text file.

Graham Mayor

unread,
Feb 4, 2003, 4:25:11 AM2/4/03
to
Can you post a sample of your data - in the message not as an attachment.
Half a dozen records will do it - and by all means change any sensitive
information. My guess is that it would be a good idea to add an extra field
or two to the text file to provide the ready converted number formats for
the merge. I need to see the data to see how practical this would be, as you
don't want to have to edit all the records individually :-(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail gma...@mvps.org
Web site www.gmayor.dsl.pipex.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>

Cindy Meister -WordMVP-

unread,
Feb 4, 2003, 4:56:32 AM2/4/03
to
Hi Paul,

> The data source is a comma delimited text file.
>

Mmmm. Not much leeway there, I'm afraid. :-( If it had
been, say, Access or even Excel, the problem could have
been solved using a query expression. But the connection
methods for text files don't support much in the way of SQL
functions within Word.

Unless you're using Word 2002? Then, with an OLEDB
connection, you can do something like this with VBA:

ActiveDocument.MailMerge.DataSource.QueryString= "SELECT
Product, (Left([Y2000], Instr([Y2000], '.')-1) & ',' &
(Left(Format(Mid([Y2000], Instr([Y2000], '.')+1)*10, '00'),
2))) as Y2K, Y2001, Y2002 FROM `SalesData#txt`"

Peter Jamieson

unread,
Feb 4, 2003, 5:52:58 AM2/4/03
to
It should also be possible with the ODBC text driver in Word 2000 and
earlier, since it also lets you use Jet SQL, as long as ODBC can recognise
the .txt file format, and this will probably require the file format to be
specified in the ODBC Administrator, which creates a SCHEMA.INI file in the
same directory as the .txt file.

But it's definitely trickier to get this right...

--
Peter Jamieson
MS Word MVP

"Cindy Meister -WordMVP-" <CindyM...@swissonline.ch> wrote in message
news:VA.00007193.006bfb39@speedy...

Paul Lister

unread,
Feb 4, 2003, 11:02:06 AM2/4/03
to
Here is a sample of the number data
"10870.81", "4.25", "0", "74755.69", "497.11", "100"

I have text files with between 100 and 1300 fields, while
it would be possible to provide each number in both
formats and not apply a number picture, it would take too
much time. The mail merge is being performed by word
though automation on a stand alone server, and the client
only has access to the document. I need to have the same
document to display both or either French or English
number formats.

Can I with VB add a control to convert the number formats
for me. It would need to be able to use a merge field to
determin what the format should be. Assigning the merge
field data to a variable change the number as if it was a
string so that I can get the correct formatting. Then
outputting the string in the location of the control in
the document. Is something like this even possible?

Graham Mayor

unread,
Feb 4, 2003, 11:56:04 AM2/4/03
to
You may still be thinking of producing a more complicated solution than is
required here.

Given numbers in this format, it would be relatively simple to produce data
fields using the replace function to set the English/French versions, by
performing a set of three (maybe fewer) replacements - which can be
automated. By such a method you can insert two new fields after each current
field by use of wildcard insertions - see
http://www.mvps.org/word/FAQs/General/UsingWildcards.htm

However, to determine how to do this effectively it would be necessary to
see a sample of the data file ie with its header information and sample
records, rather than just a list of numbers, with no indication of what
separates individual records.

Are there going to be unrelated numbers in any of the other fields?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail gma...@mvps.org
Web site www.gmayor.dsl.pipex.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>

Peter Jamieson

unread,
Feb 4, 2003, 12:20:53 PM2/4/03
to
If you are using Word XP then you can use Word's Mailmerge events to modify
the mail merge main document just before it merges each record in the data
source, roughly along the lines you describe.

However, if you are not using Word XP (and probably even if you are) I think
Graham's approach is likely to be the simplest, given that the entire merge
process is automated anyway.

--
Peter Jamieson
MS Word MVP

"Paul Lister" <pa...@stratinfotech.com> wrote in message
news:04db01c2cc66$c42959d0$89f82ecf@TK2MSFTNGXA01...

Paul Lister

unread,
Feb 5, 2003, 11:25:27 AM2/5/03
to
I found a very simple solution. If I change the
formatting in the datasource to French, word will allow me
to display it that way if I don't add a number picture.
If I do include a number picture the formatting changes to
English. That simple.

Thank you so much for all the help you provided,

Paul Lister

Graham Mayor

unread,
Feb 5, 2003, 11:45:49 AM2/5/03
to
Brilliant! Thanks for posting that back.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail gma...@mvps.org
Web site www.gmayor.dsl.pipex.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>

0 new messages