1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub oApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
ActiveDocument.Unprotect ("toto")
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes("Picture 2").Visible = msoTrue
Selection.HeaderFooter.Shapes("Picture 3").Visible = msoTrue
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.Sections(1).ProtectedForForms = True
ActiveDocument.Sections(2).ProtectedForForms = True
ActiveDocument.Sections(3).ProtectedForForms = False
ActiveDocument.Sections(4).ProtectedForForms = False
ActiveDocument.Protect Password:="toto", NoReset:=False, Type:= _
wdAllowOnlyFormFields, UseIRM:=False, EnforceStyleLock:=False
End Sub |
Partager