Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2020, 08:26 AM
lerxx lerxx is offline VBA - Document protection with exceptions Windows 10 VBA - Document protection with exceptions Office 2013
Novice
VBA - Document protection with exceptions
 
Join Date: Oct 2019
Posts: 2
lerxx is on a distinguished road
Default VBA - Document protection with exceptions

Hello,



we are using the protection function in word with "exceptions", so that users can only edit defined ranges. Is it possible to disable, or if not, to delete the exceptions ranges, so that we can have an final document at the end?

Usually we would use the protectiontype wdallowonlyreading, but this is the same as required for the exceptions.

If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Password:="", noReset:=False, Type:= _
wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=False
End If

Thanks in advance!
Reply With Quote
  #2  
Old 08-05-2020, 03:50 PM
Guessed's Avatar
Guessed Guessed is offline VBA - Document protection with exceptions Windows 10 VBA - Document protection with exceptions Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If you aren't using passwords on your protection I would guess that the protection is just to stop accidental changes. If that is the case, I would do this a different way.

First, add Content Controls for each of the areas that you want to allow edits. Then to apply protection to everything else, do a Select All and group the content by going to Developer > Controls Group > Group > Group

You can then run a macro to remove all Content Controls for delivery.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 08-05-2020, 10:06 PM
gmayor's Avatar
gmayor gmayor is offline VBA - Document protection with exceptions Windows 10 VBA - Document protection with exceptions Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could use content controls for the editable space, then add 'editors' to those controls, then protect read only. See attached.


The simplest way to achieve this is with
https://www.gmayor.com/insert_content_control_addin.htm
Attached Files
File Type: docx example.docx (31.6 KB, 6 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #4  
Old 08-14-2020, 09:20 PM
Charles Kenyon Charles Kenyon is online now VBA - Document protection with exceptions Windows 10 VBA - Document protection with exceptions Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

You could also set the Content Controls to remove the content control when contents are edited. Of course that means that people get one shot at filling it in. That changes the CC to text.


Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Customizing Document Protection bgmsd Word 2 06-07-2015 07:31 AM
VBA - Document protection with exceptions Document enables protection after print ubns Word 1 09-12-2012 06:33 PM
VBA - Document protection with exceptions Protection bounces user to top of document aedmyr Word 2 04-13-2012 08:32 PM
Document protection Daved2424 Word 0 11-17-2010 01:22 AM
VBA - Document protection with exceptions need help with document protection jknyc Word 1 06-22-2009 11:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:13 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