Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2024, 02:40 AM
ADAL ADAL is offline How to lock fields with vba just in header, not in footer Windows 10 How to lock fields with vba just in header, not in footer Office 2021
Novice
How to lock fields with vba just in header, not in footer
 
Join Date: Dec 2023
Posts: 6
ADAL is on a distinguished road
Default How to lock fields with vba just in header, not in footer

Hello, as you know, in large documents that have variable headers [STYLEREF], Word becomes very slow, so the solution is to lock the fields, and after that open them (close to printing, etc.).
I do it with the command:
Code:
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Locked = False
ActiveDocument.Sections(1).Headers(wdHeaderFooterEvenPages).Range.Fields.Locked = False
The problem is that this macro also locked in footers, and I only need it in the upper headings [I know that I can add a command that will unlock the footers, but for a reason that is a bit complicated to explain, it is not relevant in my case] I am wondering how it is possible to give the command directly only to headers


Thanks
Reply With Quote
Reply

Tags
headers, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding text to the header and footer without removing all other content in the header and footer digitalelise Word VBA 2 10-23-2019 02:58 AM
How to lock fields with vba just in header, not in footer Restrict editing options to lock a picture in header scrayne Word 1 07-26-2017 08:23 PM
Header and footer aligned in the footer area ashiqghfr Word 2 07-23-2015 01:14 AM
How to lock fields with vba just in header, not in footer How to Lock header numbers? HenDrake Word 3 07-20-2011 02:11 AM
Different Header but same Footer Karthick Word 1 11-12-2010 09:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft