Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2013, 08:13 AM
bandrist bandrist is offline Uncheck Checkbox Code not working if document protected Windows 7 32bit Uncheck Checkbox Code not working if document protected Office 2010 32bit
Novice
Uncheck Checkbox Code not working if document protected
 
Join Date: Aug 2013
Posts: 2
bandrist is on a distinguished road
Default Uncheck Checkbox Code not working if document protected

I'm a total novice when it comes to VBA. I found the following code on another forum and copied it in order to program a command button to reset form fields on a Word document that is protected. The text boxes and drop downs are resetting properly but the checkboxes are not becoming unchecked while protection is on. However, if I stop protection and click the command button, the check boxes become unchecked. How can I get this to work when the document is protected?

Private Sub CommandButton1_Click()
Dim oFF As FormField
For Each oFF In ActiveDocument.Range.FormFields
Select Case oFF.Type


Case Is = wdFieldFormTextInput
oFF.Result = ""
Case Is = wdFieldFormDropDown
oFF.DropDown.Value = 1
Case Is = wdFieldFormCheckBox
oFF.Result = False
End Select
Next oFF
End Sub
Reply With Quote
  #2  
Old 08-14-2013, 08:27 AM
gmaxey gmaxey is offline Uncheck Checkbox Code not working if document protected Windows 7 32bit Uncheck Checkbox Code not working if document protected Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,422
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Case Is = wdFieldFormCheckBox
oFF.CheckBox.Value = False
End Select
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 08-14-2013, 09:02 AM
bandrist bandrist is offline Uncheck Checkbox Code not working if document protected Windows 7 32bit Uncheck Checkbox Code not working if document protected Office 2010 32bit
Novice
Uncheck Checkbox Code not working if document protected
 
Join Date: Aug 2013
Posts: 2
bandrist is on a distinguished road
Default

Thanks Greg. Worked like a charm.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Uncheck Checkbox Code not working if document protected Protected Document: Multiple Hyperlinks Andrew H Word VBA 7 11-26-2012 01:08 PM
Checkbox in word document ubns Word 1 07-10-2012 09:03 PM
Using bookmarks in a protected document Bill Stemp Word 0 10-16-2010 06:47 AM
Problems working in a partially protected document Autumn Excel 0 02-11-2009 03:46 PM
Excel ->VB code for Checkbox (control toolbox) kirkstyle Excel 0 08-16-2006 04:17 PM

Other Forums: Access Forums

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