Misspelled words

W

Wagon

I Have a very large word list that I would like to reduce. Is the a
way I can put it in word and write a VBA code that if it is misspelled
to DELETE the word. Intutively it should be simple but I do not know
how to approach it
 
G

Greg Maxey

If the word list is a simple list made up of individual paragraphs (i.e.,
one word per line) then a simple check like this might work:

Sub ScanList()
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Range.Paragraphs
If oPara.Range.SpellingErrors.Count = 1 Then
oPara.Range.Delete
End If
Next
End Sub
 
J

Jean-Guy Marcil

[email protected] was telling us:
[email protected] nous racontait que :
I Have a very large word list that I would like to reduce. Is the a
way I can put it in word and write a VBA code that if it is misspelled
to DELETE the word. Intutively it should be simple but I do not know
how to approach it

Try this to delete all spelling errors in the document:

Dim MissSpeltWords As ProofreadingErrors
Dim myMissSpeltWord As Range

Set MissSpeltWords = ActiveDocument.SpellingErrors
For Each myMissSpeltWord In MissSpeltWords
myMissSpeltWord.Delete
Next



--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top