![]() |
#2
|
||||
|
||||
![]()
You need a macro stored in the document to unprotect the document, run the spell check then re-protect it again e.g.
Code:
Sub SpellCheckForm() Dim i As Integer Dim bProtected As Boolean 'Unprotect the file If Not ActiveDocument.ProtectionType = wdNoProtection Then bProtected = True ActiveDocument.Unprotect Password:="" End If ActiveDocument.Range.NoProofing = True 'check each formfield for spelling For i = 1 To ActiveDocument.FormFields.Count ActiveDocument.FormFields(i).Select #If VBA6 Then Selection.NoProofing = False #End If Selection.LanguageID = wdEnglishUK Selection.Range.CheckSpelling Next 'Reprotect the document. If bProtected = True Then ActiveDocument.Protect _ Type:=wdAllowOnlyFormFields, _ NoReset:=True, _ Password:="" End If lbl_Exit: Exit Sub End Sub If you want to restrict editing to the controls then you would add 'Editors' to the controls and protect the form as read only which limits editing to the controls. The spell check will still work with the document protected. You may find Insert Content Control Add-In useful for both inserting the controls and applying the editors.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
bsuedmeyer | Word | 6 | 03-20-2016 10:06 AM |
![]() |
silveringofrose | Word | 8 | 03-13-2016 09:23 AM |
Protected Document (Form) that allows Spell Check | beve56 | Word | 3 | 03-21-2014 06:15 PM |
Spell check checking only part of document | Adeyo | Word | 1 | 02-24-2013 10:49 PM |
![]() |
troybuell | Word | 1 | 07-23-2012 12:08 PM |