delete misspelled words ...

L

LarryLev

I have a list of 300 pages of single words on a line. some of them are
words and some of them are just collections of letters and numbers. I
want to test each `word,' determine if it is a word or if it is
misspelled and delete those items that are not words. I want to end of
up with a list of english words out of the list of gibberish and
words.

I can highlight the word, though I don't seem to be able to assign it
to a variable, and I can't seem to test the variable for `wordiness.'
any suggestions gratefully accepted. thanks.
 
J

Jean-Guy Marcil

LarryLev was telling us:
LarryLev nous racontait que :
I have a list of 300 pages of single words on a line. some of them are
words and some of them are just collections of letters and numbers. I
want to test each `word,' determine if it is a word or if it is
misspelled and delete those items that are not words. I want to end of
up with a list of english words out of the list of gibberish and
words.

I can highlight the word, though I don't seem to be able to assign it
to a variable, and I can't seem to test the variable for `wordiness.'
any suggestions gratefully accepted. thanks.

Play around with this code to get you started:

Dim errDocument As ProofreadingErrors
Dim errSingle As Range

Set errDocument = ActiveDocument.Range.SpellingErrors

If errDocument.Count = 0 Then
MsgBox "No spelling errors found."
Else
For Each errSingle In errDocument
'Add ¶ to range
errSingle.MoveEnd wdCharacter, 1
errSingle.Delete
Next
End If



--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
L

LarryLev

LarryLev was telling us:
LarryLev nous racontait que :



Play around with this code to get you started:

Dim errDocument As ProofreadingErrors
Dim errSingle As Range

Set errDocument = ActiveDocument.Range.SpellingErrors

If errDocument.Count = 0 Then
MsgBox "No spelling errors found."
Else
For Each errSingle In errDocument
'Add ¶ to range
errSingle.MoveEnd wdCharacter, 1
errSingle.Delete
Next
End If

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:http://www.word.mvps.org

um, nothing. ... but thanks for the effort ...
 
J

Jean-Guy Marcil

LarryLev was telling us:
LarryLev nous racontait que :
um, nothing. ... but thanks for the effort ...

What do you mean "um, nothing"?

I tested it on a document set to English as the main language and with words
on single lines (exactly like your description). I added nonsense words to
the list and then ran the code I posted. All the nonsense stuff got deleted.

If it does not work, then you either did something wrong with the code or
your document is not set up as you described exactly.

Post a sample of your document content and the actual code you tried.

--

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