Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-18-2024, 01:05 PM
Tshirks Tshirks 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 2021
Novice
Showing/hiding bookmark text based on checkbox - error '6290' property only available for checkbox
 
Join Date: Jun 2024
Posts: 2
Tshirks is on a distinguished road
Default Showing/hiding bookmark text based on checkbox - error '6290' property only available for checkbox

Please be kind as I am very new to document controls and have never used VBA until now. I also am not able to upload an example document because of test security requirements.

I am a school psychologist and have to write psychological evaluation reports after I finish testing a student that include all of the information/scores from the evaluations.

I have a template document that includes multiple different types of content controls (text, dropdown lists, .... and checkboxes).

At the beginning of the report, I have a list of all the different tests I give with checkboxes next to each one. I tagged each checkbox with the specific test name (for example "Assessment1").

At the end of the report I have a bunch of tables where I input different test scores. Each table is also saved as a bookmark.

The bookmark tag matches a tag on one of the checkboxes. (so I have a checkbox tagged as "Assessment 1" and a bookmark tagged as "Assessment 1".

I want to make it so if the checkbox is not checked, the bookmark will be hidden (only show the text for the tests that I am using). After looking online, I pasted the following into the Visual Basic under content control on exit:

(Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
If ContentControl.Tag <> "" Then
ActiveDocument.Bookmarks(ContentControl.Tag).Range .Font.Hidden = Not ContentControl.Checked
End If
End Sub

This works; however, now when I click out of any of content controls that are not checkboxes, I get an error message that says "Run-time error '6290': This property is only available for checkbox content controls."



I have been playing with this for about 3 hours and cannot find anything on how to fix this. Please help!
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 04:11 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