Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2022, 10:21 PM
philip.anthony philip.anthony is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2019
Novice
How to Display Text on Multiple dropdown content control result
 
Join Date: Mar 2022
Location: Malaysia
Posts: 6
philip.anthony is on a distinguished road
Default How to Display Text on Multiple dropdown content control result


Anyone can help How to Display Text on Multiple dependent dropdown content control result? Attache the doc. Please assist how to make the vba coding

eg.
Level 0 Dropdown:
Option2
Level 1 Dropdown:
Fire
Level 2 Dropdown:
Red
Level 3 Dropdown:
100
Display Text below (Level 1 Result & Level 3 Result) = text “Match the requirement. You are qualified”

The text Change on every result

Plain text CC
Click or tap here to enter text.
Attached Files
File Type: docm Content Controls - Multi-Dependent Dropdown B.docm (38.3 KB, 14 views)
Reply With Quote
  #2  
Old 03-25-2022, 01:02 AM
Guessed's Avatar
Guessed Guessed is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
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

You've already got code in your document that changes the content in the dropdowns. Please explain more clearly what it is that you want to happen.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 03-25-2022, 02:34 AM
philip.anthony philip.anthony is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2019
Novice
How to Display Text on Multiple dropdown content control result
 
Join Date: Mar 2022
Location: Malaysia
Posts: 6
philip.anthony is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
You've already got code in your document that changes the content in the dropdowns. Please explain more clearly what it is that you want to happen.
Hi Andrew,

Thanks for your reponse. The doc only with multiple dependent dd. What I what is upon selecting the multiple item for instant level 1 & level 3, I want some text to be displayed. in another plain text CC. My bad not the coding below is not good syntax. Its just an example to show what i want. No sure how to achieve this.

eg.

Select Case CCtrl.Tag
Case "Level 1" && Level 3
Set cc1 = CCtrl.Range.Document.SelectContentControlsByTag("L ogs")(1)
Select Case CCtrl.Range.Text
Case "Fire" && "100"
cc1.Range.Text = "whatever text you want for abc"
Case "Earth" && "600"
cc1.Range.Text = "whatever text you want for def"
Case "Air" && "1200"
cc1.Range.Text = "whatever text you want for ghi"
Case Else
cc1.Range.Text = vbNullString
End Select
Reply With Quote
  #4  
Old 03-25-2022, 06:14 AM
macropod's Avatar
macropod macropod is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-25-2022, 07:05 AM
philip.anthony philip.anthony is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2019
Novice
How to Display Text on Multiple dropdown content control result
 
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
  #6  
Old 03-25-2022, 02:01 PM
Charles Kenyon Charles Kenyon is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,455
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Just clarifying, in the dependent content control, you want something different to display than was selected in the drop-down, based on the choice made in the drop-down.
If that is correct, you are on the right track.

If, on the other hand, you want the same text to display in multiple locations, then use a mapped Content Control. Repeating Data Using Document Property Content Controls and Other Mapped Content Controls
Reply With Quote
  #7  
Old 03-25-2022, 02:46 PM
macropod's Avatar
macropod macropod is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by philip.anthony View Post
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.
The code in the first link I provided shows how to output to a single content control. If you want to have the same output displayed in multiple content controls, either:
• map those content controls; or
• use VBA code to loop through your "Seats " collection. For example, using the approach in that link:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, Seats As String
With ContentControl
  If .Title = "Room" Then
    For i = 1 To .DropdownListEntries.Count
      If .DropdownListEntries(i).Text = .Range.Text Then
        Seats = .DropdownListEntries(i).Value
        Exit For
      End If
    Next
    With ActiveDocument.SelectContentControlsByTag("Seats ")
      For i = 1 To .Count
        .Item(i).Range.Text = Seats
      Next
    End With
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 03-26-2022, 11:17 PM
philip.anthony philip.anthony is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2019
Novice
How to Display Text on Multiple dropdown content control result
 
Join Date: Mar 2022
Location: Malaysia
Posts: 6
philip.anthony is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Just clarifying, in the dependent content control, you want something different to display than was selected in the drop-down, based on the choice made in the drop-down.
If that is correct, you are on the right track.

If, on the other hand, you want the same text to display in multiple locations, then use a mapped Content Control. Repeating Data Using Document Property Content Controls and Other Mapped Content Controls
Hi Charles,

Yes want something different to display than was selected in the drop-down, based on the choice made in the drop-down.

Meaning, base on the value of 2nd Drop down & 4th Dropdown, I it to be display in the text box.


I've Attachedmy Work also. Please review and guide me how to approach that.
Attached Files
File Type: docm HardwareDescription.docm (48.3 KB, 6 views)
Reply With Quote
  #9  
Old 03-26-2022, 11:28 PM
philip.anthony philip.anthony is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2019
Novice
How to Display Text on Multiple dropdown content control result
 
Join Date: Mar 2022
Location: Malaysia
Posts: 6
philip.anthony is on a distinguished road
Default

Hi Paul,

This approach is good. But, it limits to 255 char. I want to display more than 255 chars. However, I am able to do that. What I need is base on the value of 2nd Drop down & 4th Dropdown, I it to be display in the text box.

I need each selection for Level 3 and value select from level 1, and display text in the text box
eg.
Case "Microsoft Windows"
' I need a validation and Display text differently according to the Brand
' For Each CCtrl In ActiveDocument.ContentControls
' If CCtrl.Tag = "Brand" Then
' Select Case CCtrl.Range.Text
' Case "IBM"
' StrDetails = "IBM Windows"
' Case "DELL"
' StrDetails = "DELL Window"
' Case "HP"
' StrDetails = "HP Windows"
' End Select

I've Attached my Work also. Please review and guide me if the coding is ok.
Attached Files
File Type: docm HardwareDescription.docm (48.3 KB, 7 views)
Reply With Quote
  #10  
Old 03-27-2022, 04:39 PM
macropod's Avatar
macropod macropod is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

None of the examples you've given has anything like 255 characters per item. In any event, I've already given you a link that shows how the conditional output can be held in code rather than in the content control values: https://www.msofficeforums.com/word-...tml#post132696
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 03-28-2022, 02:00 AM
philip.anthony philip.anthony is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2019
Novice
How to Display Text on Multiple dropdown content control result
 
Join Date: Mar 2022
Location: Malaysia
Posts: 6
philip.anthony is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
None of the examples you've given has anything like 255 characters per item. In any event, I've already given you a link that shows how the conditional output can be held in code rather than in the content control values: https://www.msofficeforums.com/word-...tml#post132696
Hi Paul,

Have you gone thru the doc. The link you sent precisely as what I have created.. Thats working now which I dont want that. What I want is to display text based on test 2 dropdown list result. Which not sure how to achieve that.
Reply With Quote
  #12  
Old 03-28-2022, 02:15 PM
macropod's Avatar
macropod macropod is offline How to Display Text on Multiple dropdown content control result Windows 10 How to Display Text on Multiple dropdown content control result Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The code in the link clearly shows how to do that...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Display Text on Multiple dropdown content control result Content Control values NOT display name silverspr Word VBA 9 09-30-2020 07:53 AM
How to Display Text on Multiple dropdown content control result Auto populate a text field based on Content Control Dropdown List matthias92701 Word VBA 2 05-02-2019 03:54 PM
Content Control DropDown List gabster Word VBA 4 04-30-2019 09:53 PM
How to Display Text on Multiple dropdown content control result Dropdown content control and tables hrzagi Word 1 12-17-2017 09:38 PM
How to Display Text on Multiple dropdown content control result Content Control Dropdown Dependencies asteinroeder Word VBA 5 10-28-2015 03:56 PM

Other Forums: Access Forums

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