Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-14-2023, 07:23 PM
Guessed's Avatar
Guessed Guessed is offline Hiding rich text content control using checkbox - Removing extra spacing Windows 10 Hiding rich text content control using checkbox - Removing extra spacing Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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

Try this code. Put it into the ThisDocument Module to have it run automatically when you exit any content control.
Code:
Private Sub Document_ContentControlOnExit(ByVal myCC As ContentControl, Cancel As Boolean)
  Dim aCC As ContentControl
  If myCC.Title = "Checkbox" Then
    For Each aCC In ActiveDocument.SelectContentControlsByTitle("ContentControl")
      aCC.Range.Font.Hidden = Not myCC.Checked
      aCC.Range.Paragraphs.Last.Range.Font.Hidden = Not myCC.Checked
    Next aCC
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding rich text content control using checkbox - Removing extra spacing Rich text Content Control Duplicate or Alternative BarnabyS Word 11 10-08-2020 12:06 PM
Copy Formatted Text in one Rich Text Content Control to another Rich Text Content Control Haygordon Word 1 04-05-2019 05:43 AM
Hiding rich text content control using checkbox - Removing extra spacing Replicate rich text content control value at top of each page gebobs Word 5 05-16-2018 06:00 AM
Hiding rich text content control using checkbox - Removing extra spacing How do you set rich text in a content control Testor Word VBA 4 07-08-2012 07:55 AM
Hiding rich text content control using checkbox - Removing extra spacing Rich Text Content Control - Allow User Formatting keithacochrane Word 1 05-28-2012 05:06 PM

Other Forums: Access Forums

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