CasewareDocs

SmartCheckBox

Properties:

Example

Sub Main() 
Dim oParameters As Object
Dim oCheckBox As Object
Dim isChecked As Boolean

'Get parameters from SmartContext.
Set oParameters = SmartContext.Parameters

'Optimistic approach - control has to be available, otherwise the macro will fail.
Set oCheckBox = oParameters.Item("smartCheckBox1")
isChecked = oCheckBox.Checked

'Recommended way of accessing controls.
If oParameters.Contains("smartCheckBox1") Then
Set oCheckBox = oParameters.Item("smartCheckBox1")

If oCheckBox.Checked Then
'Do something in case the check box is checked.
Else
'Do something else or nothing in case the check box is not checked.
End If
End If

'An alternative
If oParameters.Contains("smartCheckBox1") Then
If oParameters.Item("smartCheckBox1").Checked Then
'Do something in case the check box is checked.
End If
End If

Set oCheckBox = Nothing
Set oParameters = Nothing
End Sub