How to cycle through each of property and its value of Class?

G

Guest

Hi all,

I just wonder a way to go through all the properties and each value.

I have a Class called clsFund and in it:
++++
Dim m_szName As String
Dim m_szID As String

Property Let pName(szName As String)
m_szName = szName
End Property

Property Get pName() As String
pName = m_szName
End Property

Property Let pID(szID As String)
m_szID = szID
End Property

Property Get pID() As String
pID = m_szID
End Property
++++

Then I want a For Each... loop like method to invoke in order to cycle
through each property (pName and pID) and it's value!

Thanks for your time.
 
B

Bob Phillips

There is no built-in to list all the properties and methods of a class. You
would need to write something that read the class module and extracted it.

You can get it via Intellisense. Write some code that references the class,
then type the class object name and a . (dot) and the intellisense drop-down
shows you all the properties and methods.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top