View Single Post
 
Old 09-14-2015, 06:00 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
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 will need a macro in the ThisDocument module of the document, and save the document as macro enabled. Name the dropdown 'Room' and the text CC as 'Seats' then change the case statements to reflect the number of seats for each room in the list (only three shown in the example). Then when you leave the dropdown, the text field is updated according to the selection.

Code:
Option Explicit

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oCC As ContentControl
    For Each oCC In ActiveDocument.ContentControls
        If oCC.Title = "Room" Then
            Select Case oCC.Range.Text
                Case "Room 1"
                    ActiveDocument.SelectContentControlsByTitle("Seats").Item(1).Range.Text = "63 Seats"
                Case "Room 2"
                    ActiveDocument.SelectContentControlsByTitle("Seats").Item(1).Range.Text = "25 Seats"
                Case "Room 3"
                    ActiveDocument.SelectContentControlsByTitle("Seats").Item(1).Range.Text = "42 Seats"
                Case Else
                    ActiveDocument.SelectContentControlsByTitle("Seats").Item(1).Range.Text = ActiveDocument.SelectContentControlsByTitle("Seats").Item(1).PlaceholderText
            End Select
        End If
    Next oCC
lbl_Exit:
    Set oCC = Nothing
    Exit Sub
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