Private Sub Command1_Click()
If IsTextUload(1) = True Then
MsgBox "Text1(1)已经卸载了", vbInformation, "提示"
End If
End Sub
Private Sub Command2_Click()
Unload Text1(1)
End Sub
Function IsTextUload(ByVal Index As Integer) As Boolean
On Error GoTo Z
Dim ret As String
ret = Text1(Index).Text '尝试赋值,如果 Text1(Index) 不存在,即卸载了,将发生一个对象不存在错误
IsTextUload = False
Exit Function
Z:
IsTextUload = True
End Function