View Single Post
 
Old 03-07-2016, 01:55 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Try something along the lines of:
Code:
Sub Demo()
Dim oCol As New Collection
Dim oColPN As New Collection
Dim oRng As Word.Range
Dim RngTmp As Word.Range
Dim oDoc As Word.Document
Dim lngIndex As Long
Set oRng = ActiveDocument.Range
With oRng.Find
  .Text = "<[A-Z]{1,5}>"
  .MatchWildcards = True
  While .Execute
    On Error Resume Next
    Set RngTmp = oRng.Paragraphs.First.Range
    With RngTmp
      .End = .End - 1
    End With
    oCol.Add oRng.Text & vbTab & RngTmp.Text, oRng.Text
    If Err.Number = 0 Then
      oColPN.Add oRng.Information(wdActiveEndPageNumber)
    End If
    On Error GoTo 0
    oRng.Collapse wdCollapseEnd
  Wend
End With
Set oDoc = Documents.Add
For lngIndex = 1 To oCol.Count
  oDoc.Range.InsertAfter oCol(lngIndex) & " " & oColPN(lngIndex) & vbCr
Next lngIndex
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote