Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
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,144
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 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
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:25 PM.


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