PDA

View Full Version : Spell Check Macro - Word and Word:Mac



RussTX
11-10-2007, 08:50 PM
I'm new to macros and at this time know only enough to be dangerous. I developed a fillable form in Word 2000 for use in our office. Thanks to several excellent posts in this forum, I was able to copy a spellcheck macro from this site and embed it in my document to check all fillable fields only. This macro works to perfection (see below).

Here's my problem. A large part of our group use Macs with Word:Mac. My form loads well in the Word:Mac program and can be filled in without any problems. When spellcheck is initiated, it will scan through the complete form but will not find any misspelled words (and I put some in there). I read that Word 2000 and up uses VBA6 and all Word:Macs use 5. Can someone take a look at the following macro and tell me how to modify to work on the Macs. Macs are G4 laptops using OSX, Word:Mac 11.3.8 I absolutely appreciate any help provided. :dunno

Sub myTotalCheckSpelling()
Dim iCnt AsInteger

With Application.ActiveDocument
'Unprotect if protected
If .ProtectionType <> wdNoProtection Then _
.Unprotect Password:=""

'Loop all formfields
For iCnt = 1 To .FormFields.Count
'Select formfield
.FormFields(iCnt).Select

#If VBA6 Then
'Only Word > 2000
Selection.NoProofing = False
#EndIf
'Set Language
Selection.LanguageID = wdEnglishUK
'Run spell checker
Selection.Range.CheckSpelling
Next

'Reprotect without resetting the fields
.Protect Type:=wdAllowOnlyFormFields, Noreset:=True, Password:=""

MsgBox "Demo all fields spell check completed", vbInformation
End With
End Sub