May I point out that
9-digit phone number "xxxxxxxxx
is indeed 9 digits.
However....
(xxx) xxx-xxxx
is 10 digit, PLUS a space - between the paraenthesis and the remaining 7
digits.
The space is not a problem, but please tell me what determines the missing
digit (from 9 to 10)? Are you making up a number for the start? For the end?
Somewhere in between?
All kidding aside (and I hope that was a typo re: 9 digit), there is another
possibility, if this is important.
You can have a macro that MUST be executed when you finish typing your - ahem
- 10 digits.
xxxxxxxxxx
As SOON AS YOU TYPE IT, execute the following. I have it set up for a
keyboard shortcut of Alt-p, so type:
xxxxxxxxxx Alt-p
Sub CovertPhone()
' keyboard shortcut = Alt-P
Dim strChangedTo As String
Selection.MoveLeft Unit:=wdCharacter, Count:=10, Extend:=wdExtend
strChangedTo = Selection.Text
strChangedTo = "(" & Left(strChangedTo, 3) & ")" & _
" " & Left(Right(strChangedTo, 7), 3) & "-" & _
Right(strChangedTo, 4)
With Selection
.Text = strChangedTo
.Collapse 0
End With
End Sub
xxxxxxxxxx
is changed to
(xxx) xxx-xxxx
I have to concur that there is no way to easily do this automatically. Not
with having to have the numbers variable.