Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-14-2024, 08:33 AM
ccamm ccamm is offline Toggling control checkboxes to true when a value in a control drop down is selected Windows 10 Toggling control checkboxes to true when a value in a control drop down is selected Office 2021
Novice
Toggling control checkboxes to true when a value in a control drop down is selected
 
Join Date: Mar 2024
Posts: 2
ccamm is on a distinguished road
Default

I have made some progress with this by using case rather than if else as it is a bit cleaner

Code:
Option Explicit

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    If ContentControl.Type = wdContentControlDropdownList Then
        If ContentControl.Title = "ROLE" Then 
            ChangeCheckBoxes ContentControl
        End If
    End If
End Sub

Sub ChangeCheckBoxes(ByRef dropdownControl As ContentControl)
    Dim dropdownValue As String
    dropdownValue = dropdownControl.Range.Text
    

    Select Case dropdownValue

        Case "RSC"
            ActiveDocument.SelectContentControlsByTitle("RPT").Item(1).Checked = True
            ActiveDocument.SelectContentControlsByTitle("DS").Item(1).Checked = True
  
            
        Case "LSC" 
   
            ActiveDocument.SelectContentControlsByTitle("DS").Item(1).Checked = True
            ActiveDocument.SelectContentControlsByTitle("SPT").Item(1).Checked = True
     
            
           
                
    End Select
End Sub
I think this should work and I should be able to add onto it, however Its not triggering
Reply With Quote
 

Tags
checkbox, office365 desktop, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning Values to content control checkboxes and calculating results nuraish Word Tables 1 08-18-2021 03:14 AM
Using Content Control Checkboxes to open associated excel files shaztastic Word VBA 5 08-26-2018 07:13 AM
Toggling control checkboxes to true when a value in a control drop down is selected Content Control Checkboxes wlcdo2 Word VBA 3 01-05-2017 05:52 PM
Toggling control checkboxes to true when a value in a control drop down is selected Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
Toggling control checkboxes to true when a value in a control drop down is selected Assigning Values to content control checkboxes and calculating results creative cathy Word Tables 13 10-07-2012 08:52 PM

Other Forums: Access Forums

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