Archive

Posts Tagged ‘Spell-Check’

How to Run Spell Check in VBA

July 29th, 2008 No comments

Spell Checking in MS Word can be automated by adding a few line of code behind your word document.

Code below can be used in your VBA project. It works in Word, and it should work in Excel as well but I haven’t try it. If you encountered any problem using it in any other VBA project, post your comment here, I’ll have a look at it.

Sub RunSpellCheck()
' Run Spell Check
    If MsgBox("Do Spell Check now ?", vbYesNo) = vbYes Then
        ActiveDocument.Content.Select
        Selection.WholeStory
        Selection.LanguageID = wdEnglishAUS
        ActiveDocument.CheckSpelling
    End If
End Sub
Categories: Programming