View Single Post
 
Old 03-16-2022, 10:01 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,138
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

The selected value of a list control is the range.text. You can identify a control by its tag which is by default the same as its title, though either can be changed as required. Frankly it is difficult to see why you would put the list value in a text CC when it is already displayed in the list CC, but if you wish to do so then use the ControlOnExit event to make the update e.g. in your document.

Code:
Option Explicit

Private Sub Document_ContentControlOnExit(ByVal cc1 As ContentControl, Cancel As Boolean)
    If cc1.ShowingPlaceholderText = False Then
        ActiveDocument.SelectContentControlsByTitle("a").Item(1).Range.Text = cc1.Range.Text
    End If
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