Property/Method access using string values
Is there a way to access properties/methods of an object using string values? For example, to access the Person.Fullname property would it be possible to do the following...
Public Sub MySub()
' get fullname...
Dim name As String = GetProperty(myPerson, "Fullname")
End Sub
Public Function GetProperty(ByVal nObject As Object, _
ByVal property As String) As Object
Return nObject.property
End Function
The bit I don't know how to do is the 'Return nObject.property', or even if it is possible. Is it?
Thanks in advance
|