View Single Post
 
Old 06-13-2019, 08:01 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
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