Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
M-Hop M-Hop is offline
external usenet poster
 
Posts: 1
Default Format National Insurance Number

I am using an excel record for mailmerge and would like to format a national
insurance record. The text field is for example AA112233B, and I would like
to merge the field divided into separated segments eg. AA 11 22 33 B.
Dates and numerical data are fine, but I'm not sure exactly what is needed
for alpha-numeric?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Format National Insurance Number

As far as I am aware, there is no simple way to do this.

The options a
1. Format it correctly in the Excel data file
or.
2. Derive three additional fields from the NI field using LEFT RIGHT and MID
functions in Excel to separate the three parts of the number i.e. 2 letters
6 numbers 1 letter and merge those fields - wherein you can format the
number field in Word with a switch
http://www.gmayor.com/formatting_word_fields.htm
or
3. Merge to a new document and run a macro to format the number:

Sub FormatNI()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([A-Z]{2})([0-9]{2})([0-9]{2})([0-9]{2})([A-Z])"
.Replacement.Text = "\1 \2 \3 \4 \5"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


M-Hop wrote:
I am using an excel record for mailmerge and would like to format a
national insurance record. The text field is for example AA112233B,
and I would like to merge the field divided into separated segments
eg. AA 11 22 33 B. Dates and numerical data are fine, but I'm
not sure exactly what is needed for alpha-numeric?



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
number format Catherine Microsoft Word Help 3 June 2nd 06 09:30 PM
how do i change the page number format on a single page GoingInsane Page Layout 1 May 9th 06 04:01 AM
How do I change a bullet format back in the Bul.& Number list? W. Tucker Microsoft Word Help 2 April 24th 06 03:22 AM
format field for social security number carolina girl Microsoft Word Help 4 February 15th 06 07:32 PM
Loosing SSN number format after mailmerge Lisa Mailmerge 2 February 17th 05 03:15 PM


All times are GMT +1. The time now is 04:44 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"