In this article, we would like to introduce you 2 ways to restrict the editing of header and footer in your Word document.
As we know, header and footer of a document should keep its integrity so as to make the formatting professional. Thus, it would be nice to develop ways to prevent header or footer from either intentional or accidental modification. As usual, here are 2 methods we suggest.
Method 1: Restrict the Editing of Header and Footer Manually
- To begin with, press “Ctrl+ Home” to go to the head of the document.
- Next, click “Page Layout” tab.
- Then click “Breaks” in “Page Setup” group.
- And choose “Continuous” on the drop-down menu.
Now if you reveal all hidden marks, you shall see a continuous section break has been inserted.
- Next click “Review” tab then the “Restrict Editing” command to open the “Restrict Formatting and Editing” Pane on the right side of the screen.
- Check the “Allow only this type of editing in the document” box and select “Filling in forms” option.
- Next click “Select sections” to invoke the “Section Protection” dialog box.
- In that box, check only “Section 1” box and click “OK”.
- Then click “Yes, Start Enforcing Protection”.
- Finally, enter and reenter password then click “OK”.
By far, when you click on the header or footer area, you won’t be able to enter it.
Method 2: Restrict the Editing of Header and Footer via VBA
- Press “Alt+ F11” to open VBA editor first.
- Then click “Normal” project and then “Insert” tab.
- Select “Module” on the menu to insert anew one under “Normal” project.
- Double click the module to bring out the coding area and paste the following macro there:
Sub ProtectHeaderAndFooter() Selection.HomeKey Unit:=wdStory Selection.InsertBreak Type:=wdSectionBreakContinuous ActiveDocument.Sections(1).ProtectedForForms = True ActiveDocument.Protect wdAllowOnlyFormFields End Sub
By the way, in case you need to batch process multi-document, paste this macro instead:
Sub ProtectHeaderAndFooterInMultiDoc() Dim objDoc As Document Dim strFile As String, strFolder As String ' Initialization strFolder = "C:\Users\Public\Documents\New folder\Test2\" strFile = Dir(strFolder & "*.docx", vbNormal) ' Precess each document in the folder. While strFile <> "" Set objDoc = Documents.Open(FileName:=strFolder & strFile) Selection.HomeKey Unit:=wdStory Selection.InsertBreak Type:=wdSectionBreakContinuous ActiveDocument.Sections(1).ProtectedForForms = True ActiveDocument.Protect wdAllowOnlyFormFields objDoc.Save objDoc.Close strFile = Dir() Wend End Sub
But remember to arrange all documents in the same folder before anything else. And replace the “C:\Users\Public\Documents\New folder\Test2\” with your actual folder path.
- Lastly, click “Run”.
With the employ of macro way, there is no need to input password to protect header and footer.
Cope with Document Issues
Word documents, like all other type of files, are easy victim of software corruption. Therefore, to secure your valuable documents and prevent them from inaccessible forever, you can take the kelp of a docx fix tool.
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel corruption and pdf repair software products. For more information visit www.datanumen.com