-
-
Sorry. I'm in a hurry. Go to google. Type "word mvps" without the quotes. Take the first hit you get. Go to the macros tab at the top of the page, do a search for spell check form fields (or similar). They've got some code that I've never been able to make work.
-
I have tried that and it doesn't work for me either. I will keep trying!! Maybe I can get a few ideas from digging deeper into it. Thanks, Dreamboat!
Thanks,
Tracy
-
Well, Gerry or Tony should be by soon. They're the Word VBA Geeks.
-
Hi,
From the microsoft help.
http://support.microsoft.com/default...b;en-us;191028
Method 3: Unprotect, Check Spelling or Update a Field, Reprotect a Document
Because form field text is formatted for No Proofing, you can use the following macro to: ?Temporarily unprotect the form.?Change the language of the form fields.?Perform a spelling check or update a field.?Reprotect the form while preserving the text you've typed into the form fields.You can use this macro as an On Exit macro for the last form field so you can check the spelling or update a field before you save the form.
[VBA]
Sub FormsSpellCheck()
' If document is protected, Unprotect it.
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:=""
End If
' Set the language for the document.
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
Selection.NoProofing = False
' Perform Spelling/Grammar check.
If Options.CheckGrammarWithSpelling = True Then
ActiveDocument.CheckGrammar
Else
ActiveDocument.CheckSpelling
End If
' ReProtect the document.
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If
End Sub
[/VBA]
-
-
I got it (well it's working) but I'm sure it could be cleaned up. I had to add a bookmark to each form field and then assigned this code to a toolbar button.
[VBA] Private Sub mysplchk()
Selection.GoTo What:=wdGoToBookmark, Name:="Text1"
Selection.LanguageID = wdEnglishUS
Selection.NoProofing = False
Selection.Range.CheckSpelling
End Sub[/VBA]
I had to add these 4 lines for each form field. I am going to mark this resolved. Thanks again everyone.
Thanks,
Tracy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules