Hi Ricardo,
The following demo shows how to distinguish the cases. The name of the
constant wdSpellingCorrect is unfortunate -- if the item was really
correct, it wouldn't be in the SpellingErrors collection.
Sub SpellDemo()
Dim msg As String
Dim rgError As Range
Dim suggs As SpellingSuggestions
For Each rgError In ActiveDocument.SpellingErrors
Set suggs = rgError.GetSpellingSuggestions
Select Case suggs.spellingErrorType
Case wdSpellingCorrect:
msg = "Repeated word"
Case wdSpellingNotInDictionary:
msg = "Not in dictionary"
Case wdSpellingCapitalization:
msg = "Incorrect capitalization"
End Select
rgError.Select
MsgBox msg
Next
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>In VBA, how can you tell a misspelling from a duplicated word (a word marked
>as a misspelling because it is repeated)? It appears programmatically Word
>marks these two cases as the same even though the user interface clearly
>knows the difference (since a different set of buttons become active).
Ricardo Muiz - 20 Apr 2006 04:19 GMT
Thanks. I'm not sure I would have found that on my own.
> Hi Ricardo,
>
[quoted text clipped - 35 lines]
> >marks these two cases as the same even though the user interface clearly
> >knows the difference (since a different set of buttons become active).