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

(e-mail address removed) was telling us:
(e-mail address removed) 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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top