H
Henry Kwan
I have the following code:
Sub ClearSection()
If True Then
For Each t In ActiveDocument.Tables
ClearOneSection (t)
Next t
Else
ClearOneSection (Selection.Tables(1))
End If
End Sub
Sub ClearOneSection(ByVal t As Table)
' Do something
End Sub
For some reason, the Else statement will throw a Type Mismatch error during
runtime. The If statement runs correctly.
Does anyone have any ideas why this might be the case?
Any help is greatly appreciated.
Sub ClearSection()
If True Then
For Each t In ActiveDocument.Tables
ClearOneSection (t)
Next t
Else
ClearOneSection (Selection.Tables(1))
End If
End Sub
Sub ClearOneSection(ByVal t As Table)
' Do something
End Sub
For some reason, the Else statement will throw a Type Mismatch error during
runtime. The If statement runs correctly.
Does anyone have any ideas why this might be the case?
Any help is greatly appreciated.