Thread: [Solved] Protect header/ footer
View Single Post
 
Old 08-09-2013, 12:26 AM
czsti czsti is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Aug 2013
Posts: 6
czsti is on a distinguished road
Default Protect header/ footer

Hi,
i want protect (lock) my document header/footer for disable editing text in these.
I tried this code but with error code.

Code:
 
Private Sub Document_Open()
    Dim i As Long
    For i = 1 To ActiveDocument.Sections.Count
        ActiveDocument.Sections(i).Headers(wdHeaderFooterPrimary).Range.Locks = True
        ActiveDocument.Sections(i).Footers(wdHeaderFooterPrimary).Range.Locks = True
    Next
End Sub
Somebody help me? Thx
Reply With Quote