PDA

View Full Version : Spell Check Fillable Form Word:mac



RussTX
11-10-2007, 08:55 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 As Integer

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
#End If
'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

tpoynton
11-11-2007, 07:38 AM
I havent done anything with Word VBA, but in Excel the help file often provides alternatives, or tells you if something is not possible. I suspect you have looked at the help file as they do discuss conditional compiling.

Have you tried using the macro recorder to check spelling for a selection?

good luck!

RussTX
11-11-2007, 08:53 AM
Thanks for the reply. I just did discover the problem Friday afternoon and don't have access to the Mac this weekend. I'll look at your suggestions tomorrow. I'm really wanting to keep spellcheck to fillable areas as the forms contain a lot of nonstandard abbreviations and acronyms. Is it possible the solution could be as easy as changing the VBA6 directive?

tpoynton
11-11-2007, 09:49 AM
I was thinking that if a VBA5 equivalent exists, it might work. The only thing I've run into that requires me to use conditional compiling (in Excel) is the fact that showmodal is not an option for userforms on Macs. I recall that in Excel, 'sorttextasnumbers' also doesnt work on Macs - but this was documented in the Mac VBA help and didnt cause a compile error, if I recall correctly (although it might have!).

If you can get it working on the Mac as you want, then it should work with PC versions. People recommend that you develop on the oldest platform possible as VBA has a good bit of backward compatibility.

RussTX
11-12-2007, 06:53 PM
Okay - here's an update. Hope you're out there tpoynton. In an attempt to troubleshoot my problem, I loaded my form onto a co-workers G4 at work today. For grins, I checked the spell check on the form and it worked just as it should. So...her computer had Microsoft Word version X. The G4's I loaded the file on last week were version 11.3.8. Any idea what might be different between these two versions that could cause the macro not to function properly on the newer version? Anything specific that I should check out on the other computers?

tpoynton
11-13-2007, 06:39 AM
there are folks here more knowledgeable than I about these things. It's difficult because, as I understand, there is no error message. can you post a copy of the word doc with the code and a sample? it is odd that it doesnt work on the newer version...did you try using the macro recorder? record a macro spellchecking a selection on both versions and see if anything is different method-wise.