Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-18-2024, 06:21 PM
Guessed's Avatar
Guessed Guessed is offline Showing/hiding bookmark text based on checkbox - error '6290' property only available for checkbox Windows 10 Showing/hiding bookmark text based on checkbox - error '6290' property only available for checkbox Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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

The direct answer is to change your If line to also check that the CC is a checkbox
Code:
If ContentControl.Tag <> "" And ContentControl.Type = wdContentControlCheckBox Then
You could also use other methods to identify when a checkbox needs to change the visibility of the secondary area. All CCs have both a Tag and Title property so you could use one of these as the trigger for the macro and the other for the bookmark region.
eg
Code:
If ContentControl.Tag = "SectionShowHide" then
ActiveDocument.Bookmarks(ContentControl.Title).Range .Font.Hidden = Not ContentControl.Checked
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
contentcontrols, vba code, vba content control



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to hide and show a tabel using bookmark and checkbox Rikke Word VBA 5 05-01-2024 07:43 AM
Hiding rich text content control using checkbox - Removing extra spacing TheOstrich Word VBA 4 11-15-2023 11:58 AM
Checkbox - toggle hide/unhide other checkbox - XMLMapping GErl Word VBA 9 11-19-2020 03:15 PM
Bookmark will not show/hide based on CC Checkbox lord_kaiser Word VBA 1 04-17-2018 01:19 AM
Showing/hiding bookmark text based on checkbox - error '6290' property only available for checkbox Show/Hide Text based on Checkbox Selection tammytran105 Word VBA 7 10-02-2014 04:30 PM

Other Forums: Access Forums

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