Customizing A Number Format

B

Bob

I am merging a case number into Word 2000 that is initially in the following
format: ##-#####. I have been trying to figure out how I can format it in
the merge process to the following: ##-bk-#####. Basically, I need to insert
"bk-" after the first dash between the two number groups. I tried to adapt
the serial number example on Graham Mayor's website, but I just don't have
enough known-how to figure this out, if it can be done.
 
G

Graham Mayor

If we are looking at a seven digit number, then
\# "00-bk-00000"
or
\# "##-bk-#####"
will work

However, I suspect this isn't a number, but text, and you can't format text
with
number switches. You would have to derive the numbers in the data file
first. This would be simple enough in an Excel file.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Bob

Graham - Is it possible to "extract" the first two numbers and to thereafter
do the same with the five-number string at the end? If I can do that, then I
could easily put the "-bk-" into the merge form. Thanks.
 
D

Doug Robbins

You will have to do the manipulation in the data source. Alternatively,
after executing the mailmerge to a new document, do a Wildcard replace in
which you search for

([0-9]{2})-([0-9]{5})

and in the replace control you insert

\1-bk-\2

For an explanation of the above, see the article "Finding and replacing
characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
G

Graham Mayor

I have re-written the wildcard article for my own web site - but your
general point is confirmed that you can incorporate multiple searches as a
macro. What are the other searches?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Doug - Thanks for the link and the sample. I think it gets me to a
point that is better than where I was before, which has been perform
multiple finding and replacing tasks. I assume (and hope) there will
be a way to put this repetitive task into a macro and assign it to a
button.

Doug Robbins said:
You will have to do the manipulation in the data source.
Alternatively, after executing the mailmerge to a new document, do a
Wildcard replace in which you search for

([0-9]{2})-([0-9]{5})

and in the replace control you insert

\1-bk-\2

For an explanation of the above, see the article "Finding and
replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on
a paid consulting basis.

Hope this helps,
Doug Robbins - Word MVP
Bob said:
Graham - Is it possible to "extract" the first two numbers and to
thereafter
do the same with the five-number string at the end? If I can do
that, then I
could easily put the "-bk-" into the merge form. Thanks.

:

If we are looking at a seven digit number, then
\# "00-bk-00000"
or
\# "##-bk-#####"
will work

However, I suspect this isn't a number, but text, and you can't
format text
with
number switches. You would have to derive the numbers in the data
file first. This would be simple enough in an Excel file.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Bob wrote:
I am merging a case number into Word 2000 that is initially in the
following format: ##-#####. I have been trying to figure out how
I can format it in the merge process to the following:
##-bk-#####. Basically, I need to insert "bk-" after the first
dash between the two number groups. I tried to adapt the serial
number example on Graham Mayor's website, but I just don't have
enough known-how to figure this out, if it can be done.
 
B

Bob

Graham - The reference to multiple searches was related to multiple cases
numbers. I generally merge documents at the same time for multiple cases and
the resulting document is basically a chain of 15-20 documents from multiple
cases. I then scrolled down the document and did a find and replace to put
the case number in the correct format. I would do this for as many different
case numbers that there were in the documents. I think the wildcard search
and replace may eliminate this.

Graham Mayor said:
I have re-written the wildcard article for my own web site - but your
general point is confirmed that you can incorporate multiple searches as a
macro. What are the other searches?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Doug - Thanks for the link and the sample. I think it gets me to a
point that is better than where I was before, which has been perform
multiple finding and replacing tasks. I assume (and hope) there will
be a way to put this repetitive task into a macro and assign it to a
button.

Doug Robbins said:
You will have to do the manipulation in the data source.
Alternatively, after executing the mailmerge to a new document, do a
Wildcard replace in which you search for

([0-9]{2})-([0-9]{5})

and in the replace control you insert

\1-bk-\2

For an explanation of the above, see the article "Finding and
replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on
a paid consulting basis.

Hope this helps,
Doug Robbins - Word MVP
Graham - Is it possible to "extract" the first two numbers and to
thereafter
do the same with the five-number string at the end? If I can do
that, then I
could easily put the "-bk-" into the merge form. Thanks.

:

If we are looking at a seven digit number, then
\# "00-bk-00000"
or
\# "##-bk-#####"
will work

However, I suspect this isn't a number, but text, and you can't
format text
with
number switches. You would have to derive the numbers in the data
file first. This would be simple enough in an Excel file.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Bob wrote:
I am merging a case number into Word 2000 that is initially in the
following format: ##-#####. I have been trying to figure out how
I can format it in the merge process to the following:
##-bk-#####. Basically, I need to insert "bk-" after the first
dash between the two number groups. I tried to adapt the serial
number example on Graham Mayor's website, but I just don't have
enough known-how to figure this out, if it can be done.
 
G

Graham Mayor

If all the case numbers are in the same form at then the wildcard search
will do the trick. You can record it as a macro if you wish to save having
to remember the syntax :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Graham - The reference to multiple searches was related to multiple
cases numbers. I generally merge documents at the same time for
multiple cases and the resulting document is basically a chain of
15-20 documents from multiple cases. I then scrolled down the
document and did a find and replace to put the case number in the
correct format. I would do this for as many different case numbers
that there were in the documents. I think the wildcard search and
replace may eliminate this.

Graham Mayor said:
I have re-written the wildcard article for my own web site - but your
general point is confirmed that you can incorporate multiple
searches as a macro. What are the other searches?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Doug - Thanks for the link and the sample. I think it gets me to a
point that is better than where I was before, which has been perform
multiple finding and replacing tasks. I assume (and hope) there
will
be a way to put this repetitive task into a macro and assign it to a
button.

:

You will have to do the manipulation in the data source.
Alternatively, after executing the mailmerge to a new document, do
a Wildcard replace in which you search for

([0-9]{2})-([0-9]{5})

and in the replace control you insert

\1-bk-\2

For an explanation of the above, see the article "Finding and
replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm


--
Please respond to the Newsgroup for the benefit of others who may
be interested. Questions sent directly to me will only be
answered on
a paid consulting basis.

Hope this helps,
Doug Robbins - Word MVP
Graham - Is it possible to "extract" the first two numbers and to
thereafter
do the same with the five-number string at the end? If I can do
that, then I
could easily put the "-bk-" into the merge form. Thanks.

:

If we are looking at a seven digit number, then
\# "00-bk-00000"
or
\# "##-bk-#####"
will work

However, I suspect this isn't a number, but text, and you can't
format text
with
number switches. You would have to derive the numbers in the data
file first. This would be simple enough in an Excel file.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Bob wrote:
I am merging a case number into Word 2000 that is initially in
the following format: ##-#####. I have been trying to figure
out how
I can format it in the merge process to the following:
##-bk-#####. Basically, I need to insert "bk-" after the first
dash between the two number groups. I tried to adapt the serial
number example on Graham Mayor's website, but I just don't have
enough known-how to figure this out, if it can be done.
 
S

Sharon

Does this mean that you cannot format a field that contains both text and
numbers? For instance, I am trying to format a field for a FED EX number,
e.g., EV ### ### ### US. I have tried your website, but nothing really
addresses this that I can find.
 
D

Doug Robbins

Yes. You would need to split the data into the numeric part and the alpha
part.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
S

Sharon

So, you are saying you can't have 1 field with numbers and alpha characters?
Or are you saying you have to split the switch using numeric and alpha
characters? I have tried various ways to do the switch with both alpha and
numeric, but am unsuccessful. That doesn't mean much though because I don't
know what I am doing anyway!!
 
S

Sharon

Are you saying that you can't have field with alpha and numeric characters?
Or, are you saying you need to have the switch split into alpha and numeric
characters? I have tried various ways to have the switch do the first two
characters as alpha; the middle characters as numeric and the last two
characters as alpha, but am having no luck at all.
 
G

Graham Mayor

What we are saying is that you cannot use a number formatting switch on a
data field that contains both text and numbers. Such a field is text and
does not normally require a switch. However, in those circumstances where it
does, you need to split the data into its text and number portions to
produce separate fields text and number fields which can be combined.

In the case of your FED-EX 'numbers', if the always begin with EV and always
end in US, you don't need that part of the 'number' in your data. In the
case of a data field containing nine numerals (123456789), you can format to
produce the finished the 'number' as
EV{Mergefield FEDEX \# "### ### ###"}US
or
{Mergefield FEDEX \# "EV### ### ###US"}
both of which will produce
EV123 456 789US


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Sharon

I tried to only put the middle numbers into the Access database from where I
am getting this data, and then in the Word form had EV \# "###' '###' '###"
US, but then low and behold, instead of EV, it was EL. I was trying to look
toward the future letters/numbers in formatting it with switches in the Word
form. If it can't be done or is too difficult, I may just go back to leaving
them all in one long number and leave it at that. Thanks.
 
G

Graham Mayor

Could you not simply add another field to the Access database to carry the
prefix?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Sharon

That's what I will do!!! Thanks.

Graham Mayor said:
Could you not simply add another field to the Access database to carry the
prefix?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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