Back when I was using Word 2003, someone was kind enough to write a macro for me that checked a Word document to verify which letters of the alphabet were NOT included in the document. The macro is below. I need another macro that will report to me the opposite--which letters of the alphabet ARE present rather than which ones are missing. if anyone can help, I would be so very grateful. I have no idea where to begin, but figured this macro could be modified to make the opposite happen.
Also, if there's a way to select text in a larger document so that the macro reviews only selected text, that would be unbelievably helpful in terms of saving me time. Thanks so much in advance for any help.
Sub AtoZ()
'
' AtoZ Macro
' Checks for the presence of all letters of alphabet and reports missing ones.
'
Dim missing As String, i As Integer
missing = ""
For i = 1 To 27
Selection.Find.ClearFormatting
With Selection.Find
If Not .Execute(FindText:=Chr(64 + i), MatchCase:=False, Wrap:=wdFindContinue, Forward:=True) = True Then
missing = missing & Chr(64 + i) & ","
End If
End With
Next i
If Len(missing) > 1 Then
missing = "The following letters are not included in the text: " & Left(missing, Len(missing) - 2) & "."
Else
missing = "All of the letters of the alphabet are included in the text."
End If
MsgBox missing
End Sub