Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 03-14-2018, 11:25 AM
madempress madempress is offline Ungrouping/grouping to protect document that deletes bookmark rng at contentcontrolonexit procedure Windows 10 Ungrouping/grouping to protect document that deletes bookmark rng at contentcontrolonexit procedure Office 2016
Novice
Ungrouping/grouping to protect document that deletes bookmark rng at contentcontrolonexit procedure
 
Join Date: Mar 2018
Posts: 5
madempress is on a distinguished road
Default

Solved it!

Code:
    '(Re)Group all objects to effectively lock the document from editing again.
    Dim ctrlA As Word.Range
    Dim ctrlAcc As ContentControl
        Set ctrlA = ActiveDocument.Range
        ctrlA.Select
    Set ctrlAcc = ActiveDocument.ContentControls.Add(wdContentControlGroup, ctrlA)
Now I just have to figure out how to de-select everything at the end so it doesn't make users panic. =D
Reply With Quote
 

Tags
grouping, helpme, macro in word



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ungrouping/grouping to protect document that deletes bookmark rng at contentcontrolonexit procedure Word Document Review Procedure Suggestions FedSteve Word 1 09-01-2016 11:23 PM
Ungrouping/grouping to protect document that deletes bookmark rng at contentcontrolonexit procedure Grouping or ungrouping resets Wrapping style... why? addey Word 7 02-13-2015 05:22 AM
Ungrouping/grouping to protect document that deletes bookmark rng at contentcontrolonexit procedure Pivot table grouping problem 2 tables need different grouping differentdrummer Excel 3 12-10-2013 01:19 AM
Ungrouping/grouping to protect document that deletes bookmark rng at contentcontrolonexit procedure How do I combine two different contentcontrolonexit macros? jamles12 Word VBA 2 11-12-2013 06:51 PM
Document selection procedure kennethc Word 0 09-15-2010 02:56 PM

Other Forums: Access Forums

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