I'm new to the forum, but not new to Word. How about:
Sub ConcordanceBuilder()
Application.ScreenUpdating = False
Dim StrIn As String, StrOut As String, StrTmp As String, i As Long, j As Long, k
With ActiveDocument
StrIn = .Content.Text
For i = 1 To 255
Select Case i
Case 1 To 64, 91 To 96, 123 To 191, 247
StrIn = Replace(StrIn, Chr(i), " ")
End Select
Next
While InStr(StrIn, " ") > 0
StrIn = Replace(StrIn, " ", " ")
Wend
StrIn = " " & LCase(Trim(StrIn)) & " "
j = UBound(Split(StrIn, " "))
For i = 1 To j
If Len(Trim(StrIn)) = 0 Then Exit For
StrTmp = Split(StrIn, " ")(1)
While InStr(StrIn, " " & StrTmp & " ") > 0
StrIn = Replace(StrIn, " " & StrTmp & " ", " ")
Wend
k = j - UBound(Split(StrIn, " "))
StrOut = StrOut & StrTmp & ":" & vbTab & k & vbCr
j = UBound(Split(StrIn, " "))
Next
.Range.InsertAfter Chr(12) & StrOut
End With
Application.ScreenUpdating = True
End Sub
This sub puts the word list, with frequency count, at the end of the document - starting on a new page. The 'unwanted' character exlusion set (defined by the StrIn = Replace(StrIn, Chr(i), " ") processes) is fairly comprehensive. Adding a word exclusions list (to omit certain words from the concordance), is quite simple.
Bookmarks