Locking Header and/or Footer
Hello All,
i am new to vba programming, and i need a way to lock the header and/or footer in code after i insert some text into it (also in code).
What i have done is the following:
in the ThisDocument:
[code]
Private WithEvents wdApp As Word.Application
Private Sub Document_Open()
If wdApp Is Nothing Then
Set wdApp = ThisDocument.Application
End If
End Sub
Private Sub wdApp_WindowSelectionChange(ByVal Sel As Selection)
Select Case (Sel.StoryType)
Case wdEvenPagesHeaderStory, wdFirstPageHeaderStory, wdPrimaryHeaderStory
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Select
End Sub
[\code]
However it seems there nothing that happens, and i can edit the document header as usual. What should i do to prevent this?
I appreciate any help cause i am just a beginner.
Thanks i advance
|