Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 30th, 2006, 11:18 AM
Authorized User
 
Join Date: Nov 2005
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old January 2nd, 2007, 01:02 AM
GLM GLM is offline
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use ProtectionType property and Protect method

glm
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05:22 AM
header footer zaman1111 JSP Basics 0 July 28th, 2005 06:00 PM
addin a header and footer rom XSLT 0 July 28th, 2005 04: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 02:39 AM



All times are GMT -4. The time now is 04:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.