Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2019, 04:58 PM
forskare forskare is offline Drop Down & Text Content Control Windows 10 Drop Down & Text Content Control Office 2019
Novice
Drop Down & Text Content Control
 
Join Date: Jun 2019
Posts: 2
forskare is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 06-13-2019, 08:01 PM
gmayor's Avatar
gmayor gmayor is offline Drop Down & Text Content Control Windows 10 Drop Down & Text Content Control Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 06-13-2019, 08:12 PM
macropod's Avatar
macropod macropod is offline Drop Down & Text Content Control Windows 7 64bit Drop Down & Text Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

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]
Reply With Quote
  #4  
Old 06-13-2019, 08:21 PM
forskare forskare is offline Drop Down & Text Content Control Windows 10 Drop Down & Text Content Control Office 2019
Novice
Drop Down & Text Content Control
 
Join Date: Jun 2019
Posts: 2
forskare is on a distinguished road
Default

Thank you very much. I now have some extensive study to do. I appreciate your help.
Ken
Reply With Quote
Reply



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
Drop Down & Text Content Control 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
Drop Down & Text Content Control 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

Other Forums: Access Forums

All times are GMT -7. The time now is 07:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft