View Single Post
 
Old 05-28-2023, 09:43 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
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

Sorry, I missed this the other day
What you propose is easy enough with content controls. You need a list box to make the selection, a rich text control for the related value and a macro to evaluate the selection(s) and fill the text control(s) appropriately.
You may find Insert Content Control Add-In useful.
The macro must go in the ThisDocument module of the form template and would be something like:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oCC As ContentControl
    With ContentControl
        If .ShowingPlaceholderText = False Then
            Select Case .Title
                Case Is = "System"
                    Set oCC = ActiveDocument.SelectContentControlsByTitle("Queues Impacted").Item(1)
                    Select Case .Range.Text
                        Case Is = "AS400"
                            oCC.Range.Text = "NA"
                        Case Is = "Genesys"
                            oCC.Range.Text = ""
                    End Select
                Case Else
            End Select
        End If
    End With
    Set oCC = Nothing
End Sub
The first level of case statements are your list boxes. The second the results according to the selected values.
__________________
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