![]() |
|
|
|
#1
|
|||
|
|||
|
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oCol As New Collection
Dim oColPN As New Collection
Dim oRng 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
oCol.Add oRng.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
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to create a automatically numbered list?
|
three_jeeps | Word | 3 | 05-30-2013 10:53 AM |
Create list using VLOOKUP and IF?
|
Ineedcoffee | Excel | 4 | 12-06-2011 01:49 AM |
Create a distribution list?
|
Emerogork | Outlook | 2 | 08-25-2011 09:04 PM |
| Create Drop Down List Box | hbradshaw | Word VBA | 0 | 09-27-2010 06:24 AM |
| How do you create a list similar to an itunes list? | hatemail13 | Excel | 1 | 08-06-2010 02:21 AM |