VB Code:
  1. Private Sub Form_Load()
  2.     MsgBox HasProperty(Form1, "Caption")
  3.     Unload Me
  4. End Sub
  5.  
  6. Public Function HasProperty(objObject As Object, strProperty As String) As Boolean
  7.     Dim varRet As Variant
  8.     On Error Resume Next
  9.     varRet = CallByName(objObject, strProperty, VbGet)
  10.     If Err.Number = 0 Then
  11.         HasProperty = True
  12.     End If
  13.     On Error GoTo 0
  14. End Function