#1
|
|||
|
|||
Drop Down & Text Content Control
I'm designing a Word template to be used by staff when an HOA Violation notice is sent. The code numbers would be in a Drop down box. When the user selects the code number, the code itself (text) would appear right below or next to the Drop Down Box. Can this be done? If so How? Is there a better way? Thanks for your responses. Ken |
#2
|
||||
|
||||
You can do it with a list box and a rich text (or plain text) content control and a macro.
You may find https://www.gmayor.com/insert_content_control_addin.htm useful The macro goes in the ThisDocument module of the document. Change the control titles to reflect what you have inserted. Code:
Option Explicit Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Dim oCC As ContentControl Select Case ContentControl.Title Case "DropDownBoxTitle" Set oCC = ActiveDocument.SelectContentControlsByTitle("Code Text").Item(1) If ContentControl.ShowingPlaceholderText = False Then Select Case ContentControl.Range.Text Case "1": oCC.Range.Text = "Text for item 1" Case "2": oCC.Range.Text = "Text for item 2" 'etc End Select End If Case Else End Select Set oCC = Nothing End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
||||
|
||||
See also:
https://www.msofficeforums.com/word-...html#post46903 https://www.msofficeforums.com/word-...tml#post120392 https://www.msofficeforums.com/word-...down-list.html https://www.msofficeforums.com/word-...recursive.html https://www.msofficeforums.com/word-...down-list.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
Thank you very much. I now have some extensive study to do. I appreciate your help.
Ken |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copy Formatted Text in one Rich Text Content Control to another Rich Text Content Control | Haygordon | Word | 1 | 04-05-2019 05:43 AM |
Auto populate text box based on drop-down content control and repeat the process via copy paste | helenndp | Word VBA | 2 | 09-27-2018 11:04 AM |
VBA to provide text string with specific formating based on Drop down list (content control) | MP1989 | Word VBA | 4 | 07-30-2018 02:40 AM |
Table with content control drop down - change font | DebA | Word | 3 | 04-29-2018 09:07 PM |
Is there a way to anchor drop-down content control boxes so entering text doesn't change formatting? | TzarChasm | Word | 7 | 04-14-2016 06:28 PM |