View Single Post
 
Old 05-22-2018, 03:45 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use a ContentControlOnExit macro in the 'ThisDocument' code module of the document or its template, coded like:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Dim i As Long
With CCtrl
  If .Title = "Master" Then
    If .Range.Text = "N/A" Then
      For i = 1 To 2
        With ActiveDocument.SelectContentControlsByTitle("Slave")(i)
          .Type = wdContentControlText
          .Range.Text = "N/A"
          .LockContents = True
        End With
      Next
    Else
      For i = 1 To 2
        With ActiveDocument.SelectContentControlsByTitle("Slave")(i)
          If .Type = wdContentControlText Then
            .LockContents = False
            .Range.Text = ""
            .Type = wdContentControlDropdownList
          End If
        End With
      Next
    End If
  End If
End With
End Sub
In the above code, the controlling content control is titled 'Master' and the two dependent content controls are titled 'Slave'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote