Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-15-2022, 09:56 AM
dyb dyb is offline Unprotect sections in a word document using VBA Windows 11 Unprotect sections in a word document using VBA Office 2019
Novice
Unprotect sections in a word document using VBA
 
Join Date: Feb 2022
Posts: 7
dyb is on a distinguished road
Question Unprotect sections in a word document using VBA

I have a word document template which is protected and want to unprotect some of the individual sections in the document so that the text can be edited. I found an old post on VBA express by Greg Maxey that almost does what I want but it is for unprotecting the sections to allow Form Field data entry.

Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oFld As FormField
ActiveDocument.Unprotect
ActiveDocument.Protect wdAllowOnlyReading
For Each oFld In ActiveDocument.Sections(2).Range.FormFields
oFld.Range.Editors.Add wdEditorEveryone
Next
lbl_Exit:


Exit Sub

End Sub

How would I adapt this to work for text in the sections as this is not a form so does not use form fields.

Any help would be greatly appreciated.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word VBA. How best to insert sections of other documents into a main document. mc1903 Word VBA 5 10-11-2021 01:18 AM
Multiple approvers for different sections in a Word document Tombi Voice Word 2 10-19-2020 05:42 PM
Unprotect sections in a word document using VBA Macro to Unprotect password protected document pooklet Word 2 12-08-2014 01:32 AM
Printing Sections of a Word Document Andy Jenkinson Word 4 02-12-2010 02:53 AM
Unprotect header in Word Fran Word 0 12-23-2008 03:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:31 AM.


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