
need help adding to macro below
Dave Lett and Klause Linke helped with this macro. It searched thru a
document and copies words in all caps and words in parenthesis to another
document. I am using it to extract and locate accronyms. I am wondering 2
things: Where can I insert or better yet how can I insert a tab and page
number where the accronym is. I was also wondering about another code that
will search thru an entire folder and do the same thing.
Thanks
Jerry
Sub AcronExtract()
Dim sAbbr As String
Dim sText As String
With Selection
.HomeKey Unit:=wdStory
With .Find
.Text = "\(*\)"
.MatchWildcards = True
.ClearFormatting
Do While .Execute
sAbbr = sAbbr & Selection.Text & vbCrLf
Loop
End With
End With
With Selection
.HomeKey Unit:=wdStory
With .Find
.Text = "<[A-Z0-9]{3,}>"
.MatchWildcards = True
.ClearFormatting
Do While .Execute
sText = sText & Selection.Text & vbCrLf
Loop
End With
.HomeKey Unit:=wdStory
End With
Documents.Add
ActiveDocument.Range.InsertAfter sAbbr & vbCrLf & sText
End Sub