For the code below, for both appWord and gappWord, I get the error
"Public member 'GetType' on type 'ApplicationCla ss' 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.Applicatio n.
TypeName returns ApplicationClas s.
Am I using GetType correctly?
Private Sub CheckGetType(By Ref appWord As Word.Applicatio n)
With lstOut
Try
Dim strType As String = appWord.GetType .ToString
.Items.Add("Get Type: Detected " & strType)
Catch ex As Exception
.Items.Add("Get Type(1): " & ex.Message)
End Try
Try
Dim strType As String = gappWord.GetTyp e.ToString
.Items.Add("Get Type: Detected " & strType)
Catch ex As Exception
.Items.Add("Get Type(2): " & ex.Message)
End Try
End With
End Sub
--
http://www.standards.com/; See Howard Kaikow's web site.
"Public member 'GetType' on type 'ApplicationCla ss' 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.Applicatio n.
TypeName returns ApplicationClas s.
Am I using GetType correctly?
Private Sub CheckGetType(By Ref appWord As Word.Applicatio n)
With lstOut
Try
Dim strType As String = appWord.GetType .ToString
.Items.Add("Get Type: Detected " & strType)
Catch ex As Exception
.Items.Add("Get Type(1): " & ex.Message)
End Try
Try
Dim strType As String = gappWord.GetTyp e.ToString
.Items.Add("Get Type: Detected " & strType)
Catch ex As Exception
.Items.Add("Get Type(2): " & ex.Message)
End Try
End With
End Sub
--
http://www.standards.com/; See Howard Kaikow's web site.
Comment