Option Explicit On
Private Sub Document_ContentControlOnEnter(ByVal contentControl As contentControl)
'---------<
Document_ContentControlOnEnter >--------
If contentControl.Type =
wdContentControlCheckBox Then
'----<
IsCheckbox >----
'< init
>
Dim activeCheckbox As contentControl
Set activeCheckbox =
contentControl
Dim sCellText
sCellText = activeCheckbox.Range.Cells(1).Range.Text
'</ init >
'< Tabelle
markieren >
Dim activeTable As Table
Set activeTable =
activeCheckbox.Range.Tables(1)
Dim tableContentRange As Range
Set tableContentRange =
activeTable.Rows(2).Range
tableContentRange.End = activeTable.Range.End
tableContentRange.Select
'</
Tabelle markieren >
If sCellText Like "*nicht*" Then
'< ausblenden >
Selection.Expand
Unit:=wdParagraph
Selection.Range.Font.Hidden = True
Selection.Collapse wdCollapseEnd
'</ ausblenden >
activeTable.Rows(1).Cells(4).Range.ContentControls(1).Checked = False
ElseIf sCellText Like "*Trifft
zu*" Then
'<
einblenden >
Selection.Expand Unit:=wdParagraph
Selection.Range.Font.Hidden = False
Selection.Collapse wdCollapseEnd
'</ einblenden >
activeTable.Rows(1).Cells(3).Range.ContentControls(1).Checked = False
End If
'----< IsCheckbox
>----
End If
'---------</ Document_ContentControlOnEnter
>--------
End Sub
|