D
dworst
I have a MS Word document form in which I have a combo box with the
values of Select, Assessment Period and Project. Upon the user
selecting a value I want rows of a table to hide or unhide. I've
assigned the below macro to the onExit of the Combo Box called
AssessmentType. When I run it I get this error message. Could someone
help me out with what is incorrect here?
Thanks so much.
Object doesn't support this property or method.
Public Sub AssessmentType()
If (ActiveDocument.ComboBox("AssessmentType").Result) = "Assessment
Period" Then
ActiveDocument.Unprotect
ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = True
ActiveDocument.Tables(2).Rows(3).Range.Font.Hidden = False
If (ActiveDcoument.ComboBox("AssessmentType").Result) = "Project" Then
ActiveDocument.Unprotect
ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = False
ActiveDocument.Tables(2).Rows(3).Range.Font.Hidden = True
Else
If (ActiveDocument.ComboBox("AssessmentType").Result) = "Select" Then
ActiveDocument.Unprotect
ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = True
ActiveDocument.Tables(2).Rows(3).Range.Font.Hidden = True
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset
End If
End If
End If
End Sub
values of Select, Assessment Period and Project. Upon the user
selecting a value I want rows of a table to hide or unhide. I've
assigned the below macro to the onExit of the Combo Box called
AssessmentType. When I run it I get this error message. Could someone
help me out with what is incorrect here?
Thanks so much.
Object doesn't support this property or method.
Public Sub AssessmentType()
If (ActiveDocument.ComboBox("AssessmentType").Result) = "Assessment
Period" Then
ActiveDocument.Unprotect
ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = True
ActiveDocument.Tables(2).Rows(3).Range.Font.Hidden = False
If (ActiveDcoument.ComboBox("AssessmentType").Result) = "Project" Then
ActiveDocument.Unprotect
ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = False
ActiveDocument.Tables(2).Rows(3).Range.Font.Hidden = True
Else
If (ActiveDocument.ComboBox("AssessmentType").Result) = "Select" Then
ActiveDocument.Unprotect
ActiveDocument.Tables(2).Rows(2).Range.Font.Hidden = True
ActiveDocument.Tables(2).Rows(3).Range.Font.Hidden = True
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset
End If
End If
End If
End Sub