Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-16-2020, 12:53 PM
gmaxey gmaxey is offline Checkbox - toggle hide/unhide other checkbox - XMLMapping Windows 10 Checkbox - toggle hide/unhide other checkbox - XMLMapping Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Option Explicit
Private WithEvents oCXPart As CustomXMLPart

Private Sub Document_Open()
  Set oCXPart = ActiveDocument.CustomXMLParts.SelectByNamespace("http://TheAnchorage.com").Item(1)
lbl_Exit:
  Exit Sub
End Sub

Private Sub oCXPart_NodeAfterInsert(ByVal NewNode As Office.CustomXMLNode, ByVal InUndoRedo As Boolean)
  'This event fires when the null value in a CXPart element node is replaced with a #text node containing a value.
  If Not InUndoRedo Then ProcessChange NewNode
lbl_Exit:
  Exit Sub
End Sub
Private Sub oCXPart_NodeAfterReplace(ByVal OldNode As Office.CustomXMLNode, ByVal NewNode As Office.CustomXMLNode, ByVal InUndoRedo As Boolean)
  If Not InUndoRedo Then ProcessChange NewNode
lbl_Exit:
  Exit Sub
End Sub

Sub ProcessChange(oNodePassed As Office.CustomXMLNode, Optional bDeadNode As Boolean = False)
Dim oCC As ContentControl
Dim lngIndex As Long
  Select Case oNodePassed.ParentNode.BaseName
    Case "CBM"
      If oNodePassed.Text = "true" Then
        For lngIndex = 1 To 7
          ActiveDocument.SelectContentControlsByTitle("Checkbox" & lngIndex).Item(1).Range.Font.ColorIndex = wdAuto
        Next lngIndex
      Else
        For lngIndex = 1 To 7
          ActiveDocument.SelectContentControlsByTitle("Checkbox" & lngIndex).Item(1).Range.Font.ColorIndex = wdWhite
        Next lngIndex
      End If
  End Select
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toggle Collapse/Expand via Content Control Checkbox metaflowdesigns Word VBA 5 07-08-2020 02:53 PM
Checkbox - toggle hide/unhide other checkbox - XMLMapping How to use checkbox to show/hide bookmarked text? namrehx Word VBA 16 12-14-2017 01:45 PM
Hide rows with checkbox gebobs Excel 3 03-24-2015 12:05 PM
Checkbox - toggle hide/unhide other checkbox - XMLMapping Hide Checkbox When Printing vinceplunkett Word 1 12-03-2013 01:53 AM
Checkbox - toggle hide/unhide other checkbox - XMLMapping VBA for CheckBox to Hide Slides mutchy25 PowerPoint 1 09-21-2012 01:40 AM

Other Forums: Access Forums

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