R
Rosiewednesday
I have a document with forms in it, and there are a few sections where I have
to limit the number of characters. So I inserted a Legacy Form Field text
box and then limited the characters through properties. However, when I try
to run a spell check macro, it is spell checking all of my other form fields
(these are RichText content controls), except for this one. I tried
inserting a RichText content control into the Legacy Form Field, but that
wouldn't work either. I just need to limit the characters people are typing
in this section and then spell check. To be honest, I don't even care if
it's protected or not. I've tried this macro:
Sub SCForm()
ActiveDocument.Unprotect
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
ActiveDocument.CheckSpelling
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub
And this one:
Sub FormsSpellCheck()
' If document is protected, Unprotect it.
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:="not2day"
End If
' Set the language for the document.
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
' 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
The same thing happens. It checks everything but the character limiting
one. I also tried the one recommended on the MVP, and I couldn't get that
one to work at all. I wasn't quite sure what to copy/paste and what to
delete from that huge section.
Thanks in advance.
to limit the number of characters. So I inserted a Legacy Form Field text
box and then limited the characters through properties. However, when I try
to run a spell check macro, it is spell checking all of my other form fields
(these are RichText content controls), except for this one. I tried
inserting a RichText content control into the Legacy Form Field, but that
wouldn't work either. I just need to limit the characters people are typing
in this section and then spell check. To be honest, I don't even care if
it's protected or not. I've tried this macro:
Sub SCForm()
ActiveDocument.Unprotect
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
ActiveDocument.CheckSpelling
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub
And this one:
Sub FormsSpellCheck()
' If document is protected, Unprotect it.
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:="not2day"
End If
' Set the language for the document.
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
' 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
The same thing happens. It checks everything but the character limiting
one. I also tried the one recommended on the MVP, and I couldn't get that
one to work at all. I wasn't quite sure what to copy/paste and what to
delete from that huge section.
Thanks in advance.