First this is not all my own work. The main peice came from
http://www.
experts-exchange.
com/Software/Office_Productivity/Office_Suites/MS_Office/Q_20293035.html?
qid=20293035
it is a macro that lists all words.
I put it together with some code from
http://www.officekb.com/Uwe/Forum.
aspx/word-vba/10923/Misspelled-words
which showed me how to move from misspelled word to misspelled word. (use
answer #2)
So I do not use the ignorall. I creat an array of misspelled words. Then I
go from word to word ching if I already have it and adding any I don't yet
have.Finaly I put that out as a new document.
So at long last here is the code
Sub misspelled()
Dim SingleWord As String 'Raw word pulled from doc
Const maxwords = 9000 'Maximum unique words allowed
Dim Words(maxwords) As String 'Array to hold unique words
Dim WordNum As Integer 'Number of unique words
Dim MSWs As ProofreadingErrors 'Spelling errors
Dim ttlwds As Long 'Total words in the document
Dim Found As Boolean 'Temporary flag
Dim j, k, l, Temp As Integer 'Temporary variables
Dim tword As String '
Dim Ans As String
Dim MWord As Range 'active word
Dim tmpName As String
'seting variables and conditions
System.Cursor = wdCursorWait
WordNum = 0
Set MSWs = ActiveDocument.SpellingErrors
ttlwds = ActiveDocument.SpellingErrors.Count
' Control the repeat
For Each MWord In MSWs
SingleWord = Trim(LCase(MWord))
If SingleWord < "a" Or SingleWord > "z" Then SingleWord = ""
'Out of range?
If Len(SingleWord) > 0 Then
Found = False
For j = 1 To WordNum
If Words(j) = SingleWord Then
Found = True
Exit For
End If
Next j
If Not Found Then
WordNum = WordNum + 1
Words(WordNum) = SingleWord
End If
If WordNum > maxwords - 1 Then
j = MsgBox("The maximum array size has been exceeded.
Increase maxwords.", vbOKOnly)
Exit For
End If
End If
ttlwds = ttlwds - 1
StatusBar = "Remaining: " & ttlwds & " Unique: " & WordNum
Next MWord
' Now write out the results
tmpName = ActiveDocument.AttachedTemplate.FullName
Documents.Add Template:=tmpName, NewTemplate:=False
Selection.ParagraphFormat.TabStops.ClearAll
With Selection
For j = 1 To WordNum
.TypeText Text:=vbTab & Words(j) & vbCrLf
Next j
End With
System.Cursor = wdCursorNormal
j = MsgBox("There were " & Trim(Str(WordNum)) & " different words ",
vbOKOnly, "Finished")
Selection.HomeKey wdStory
Food luck