Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 30th, 2006, 10:18 AM
Authorized User
 
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default 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

 
Old January 2nd, 2007, 01:02 AM
GLM GLM is offline
Authorized User
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use ProtectionType property and Protect method

glm





Similar Threads
Thread Thread Starter Forum Replies Last Post
HOw can i add Header and footer? NinaWilliam ASP.NET 1.0 and 1.1 Basics 0 April 25th, 2006 04:22 AM
header footer zaman1111 JSP Basics 0 July 28th, 2005 05:00 PM
addin a header and footer rom XSLT 0 July 28th, 2005 03:24 AM
Regarding Word header and footer Hari_Word General .NET 0 November 19th, 2004 06:22 AM
can footer value show in header? yancyn Crystal Reports 0 August 5th, 2004 01:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.