Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word macro needed (XP)

    I need a Word macro to delete all misspelled words in a document.
    Any idea?
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Word macro needed (XP)

    Seems a bit drastic to me, but this will do the trick.

    StuartR

    <code>
    Sub DeleteMisspelledWords()
    Dim rngError As Range

    For Each rngError In ActiveDocument.SpellingErrors
    rngError.Delete
    Next rngError

    End Sub
    </code>

  3. #3
    New Lounger
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word macro needed (XP)

    Great! thanks a lot!
    Gadi

  4. #4
    New Lounger
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word macro needed (XP)

    The only problem with this macro is that it takes forever.
    it took about 2 minutes to run it on a 700-words document

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word macro needed (XP)

    This version is somewhat faster:

    Sub DeleteMisspelledWords()
    Dim i As Long
    Application.ScreenUpdating = False
    For i = ActiveDocument.SpellingErrors.Count To 1 Step -1
    ActiveDocument.SpellingErrors(i).Delete
    Next i
    Application.ScreenUpdating = True
    End Sub

    but it's still slow. I fear there isn't much you can do about that - it's the speed of Word's spell check engine.

  6. #6
    New Lounger
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word macro needed (XP)

    Thanks, it's a liitle bit faster

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •