Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-12-2022, 07:38 AM
Strange Strange is offline Hide a bookmark with a ContentControlCheckBox Windows 10 Hide a bookmark with a ContentControlCheckBox Office 2019
Novice
Hide a bookmark with a ContentControlCheckBox
 
Join Date: Dec 2022
Posts: 3
Strange is on a distinguished road
Default Hide a bookmark with a ContentControlCheckBox

Hello,


I am new to MS VBA and i have a very special Question.
I am trying to hide a bookmarked text with a ContentControlCheckBox.

I tried this code:

Code:
Private Sub Document_ContentControlBeforeContentUpdate(ByVal ContentControl As ContentControl, Content As String)
      If ContentControl.Tag = "Checkbox1" Then
      If Content = "true" Then ActiveDocument.Bookmarks("Test1").Range.Font.Hidden = True
      If Content = "false" Then ActiveDocument.Bookmarks("Test1").Range.Font.Hidden = False
    End If
End Sub
But i just get an error message: Runtime error 6197: This object model error is not available in the current event.

What am i doing wrong? Can somebody help me with this?
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide one bookmark when Two checkboxes are checked AVarg123 Word VBA 4 04-01-2022 06:21 PM
REf Fields show Bookmark whole cell when Bookmark is created by code. pmcpowell Word VBA 2 11-16-2019 07:05 PM
Bookmark will not show/hide based on CC Checkbox lord_kaiser Word VBA 1 04-17-2018 01:19 AM
Hide a bookmark with a ContentControlCheckBox Hide error message from missing bookmark lodi123 Word 2 03-28-2017 11:24 PM
Find Bookmark, move to bookmark, execute code, repeat raymm3852 Word VBA 10 04-15-2016 06:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:29 PM.


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