Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 03-13-2016, 06:10 AM
highrise955 highrise955 is offline Protecting Document via VBA Not Working Windows 10 Protecting Document via VBA Not Working Office 2013
Advanced Beginner
Protecting Document via VBA Not Working
 
Join Date: Mar 2016
Posts: 37
highrise955 is on a distinguished road
Default

Quote:
Originally Posted by highrise955 View Post
Yes, clicking and shift-tab work fine but since the users may be inputting over a couple of hundred rows I want to make it as seamless as possible.

I'm sure there must be a way to add a new table row when exiting the "Method of Inspection" CC, I just need to figure it out.

Thanks for your help.

OK, I figured it out. I just replaced this code...

Code:
With CCtrl
  'Check that the Content Control is within our table.
  If .Range.InRange(ActiveDocument.Tables(1).Range) = False Then Exit Sub
  'Get the number of ContentControls in the table
  i = .Range.Tables(1).Range.ContentControls.Count
  'Get our ContentControl's index # in the table
  j = ActiveDocument.Range(.Range.Tables(1).Range.Start, .Range.End).ContentControls.Count
  'Check that we're using the last content control
  If i <> j Then Exit Sub
'End With
...with this code...

Code:
If CCtrl.Tag <> "MethodInspect" Then Exit Sub
...and it works perfectly. Easier than I thought.
Reply With Quote
 

Tags
protect, unprotect, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting Document via VBA Not Working Spell out a number without protecting a document vera Word VBA 2 05-20-2016 07:35 AM
Protecting document brucemc777 Word 2 01-23-2016 02:38 PM
Protecting Document via VBA Not Working Cant type into content controls in a form after protecting document using macro rgburridge Word VBA 4 01-27-2015 02:37 PM
Disabling content controls and protecting document sections. Catty Word VBA 2 11-29-2013 05:10 AM
Protecting Word Document by restricting access permissions! user Word 0 11-20-2008 01:21 PM

Other Forums: Access Forums

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