View Single Post
 
Old 09-30-2013, 04:01 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
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

If you give all the input dropdowns the title 'Input', you could use:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim StrOutput As String, CtrlID As String
If ContentControl.Type <> wdContentControlDropdownList Then Exit Sub
For Each ContentControl In ContentControls
  If ContentControl.Type = wdContentControlDropdownList Then
    If ContentControl.Title = "Input" Then
      If ContentControl.Range.Text <> ContentControl.PlaceholderText Then
        StrOutput = StrOutput & ContentControl.Range.Text & "+"
      Else
        StrOutput = StrOutput & "N/A" & "+"
      End If
    End If
  End If
  If ContentControl.Title = "Output" Then CtrlID = ContentControl.ID
Next
StrOutput = Left(StrOutput, Len(StrOutput) - 1)
ContentControls(CtrlID).Range.Text = StrOutput
End Sub
If they all have different titles, you'll need to add a series of OR tests to the 'If ContentControl.Title = "Input" Then' line.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote