View Single Post
 
Old 03-25-2022, 07:05 AM
philip.anthony philip.anthony is offline Windows 10 Office 2019
Novice
 
Join Date: Mar 2022
Location: Malaysia
Posts: 6
philip.anthony is on a distinguished road
Wink

Quote:
Originally Posted by macropod View Post
For:

Dependent Text Content Controls
https://www.msofficeforums.com/word-...html#post46903
and, for different elements from a selected item to be output to different content controls, see:
https://www.msofficeforums.com/word-...tml#post120392

Dependent Dropdown Content Controls
https://www.msofficeforums.com/word-...html#post77762
and, for multiple levels of dependency:
https://www.msofficeforums.com/word-...tml#post132696

Cascading Dropdown Content Controls
https://www.msofficeforums.com/word-...html#post94603

I've gone thru those. But not as what I expect. I want to have the coding as follow. But this for single dd content control. But the code I am looking for Multiple dd content control. How does that work?

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oCC As ContentControl
For Each oCC In ActiveDocument.ContentControls
If oCC.Title = "Room" Then
Select Case oCC.Range.Text
Case "Room 1"
ActiveDocument.SelectContentControlsByTitle("Seats ").Item(1).Range.Text = "63 Seats"
Case "Room 2"
ActiveDocument.SelectContentControlsByTitle("Seats ").Item(1).Range.Text = "25 Seats"
Case "Room 3"
ActiveDocument.SelectContentControlsByTitle("Seats ").Item(1).Range.Text = "42 Seats"
Case Else
ActiveDocument.SelectContentControlsByTitle("Seats ").Item(1).Range.Text = ActiveDocument.SelectContentControlsByTitle("Seats ").Item(1).PlaceholderText
End Select
End If
Next oCC
lbl_Exit:
Set oCC = Nothing
Exit Sub
End Sub

Last edited by philip.anthony; 03-25-2022 at 12:02 PM.
Reply With Quote