View Single Post
 
Old 06-15-2012, 12:02 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Actually, I don't need to know that - try the following macro:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim StrTxt As String
StrTxt = "|"
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "[0-9]{3}+[0-9]{3}-[0-9]{4}"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute
  End With
  Do While .Find.Found
    If InStr(StrTxt, .Duplicate.Text) = 0 Then StrTxt = StrTxt & .Duplicate.Text & "|"
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
With ActiveDocument.Range
  .InsertAfter Replace(StrTxt, "|", vbCr)
  .Characters.Last.Delete
End With
Application.ScreenUpdating = True
End Sub
A unique list of phone numbers will be output at the end of the document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote