For the code below, for both appWord and gappWord, I get the error
"Public member 'GetType' on type 'ApplicationClass' not found"
I realize the test for appWord is superflous as the parameter is passed in
as a known type, but gappWord is has a scope of the class, so a test of the
type is valid (making believe the sub does not know the pre-ordained type).
TypeOf returns Word.Application.
TypeName returns ApplicationClass.
Am I using GetType correctly?
Private Sub CheckGetType(ByRef appWord As Word.Application)
With lstOut
Try
Dim strType As String = appWord.GetType.ToString
.Items.Add("GetType: Detected " & strType)
Catch ex As Exception
.Items.Add("GetType(1): " & ex.Message)
End Try
Try
Dim strType As String = gappWord.GetType.ToString
.Items.Add("GetType: Detected " & strType)
Catch ex As Exception
.Items.Add("GetType(2): " & ex.Message)
End Try
End With
End Sub
--
http://www.standards.com/; See Howard Kaikow's web site.