Iterating through the properties of an object 
Author Message
 Iterating through the properties of an object

Is there a way to debug.print the values of all the properties of an object
without having to spell out each property name?
In otherwords, let's say I have a textbox called text1. Instead of writing....
debug.print text1.text
debug.print text1.visible
debug.print text1.enabled
...
and on and on for each property of the textbox;
Is there a simpler way I could do this? I guess I'm looking for some sort of
properties collection? I think it might look something like this....
Dim pr as Property
Set pr = New Property
For Each pr in text1
   debug.print pr, val(pr)      [or whatever]
Next
Is such a thing possible?
Thanks,
- Ian in Chicago


Sun, 16 Mar 2003 11:11:02 GMT  
 Iterating through the properties of an object

You could use the locals window, this will display the value of all
variables in Break mode, including controls and their properties.
HTH
Lin
--
Please reply to newsgroups only :-)


Quote:
> Is there a way to debug.print the values of all the properties of an
object
> without having to spell out each property name?
> In otherwords, let's say I have a textbox called text1. Instead of
writing....
> debug.print text1.text
> debug.print text1.visible
> debug.print text1.enabled
> ...
> and on and on for each property of the textbox;
> Is there a simpler way I could do this? I guess I'm looking for some sort
of
> properties collection? I think it might look something like this....
> Dim pr as Property
> Set pr = New Property
> For Each pr in text1
>    debug.print pr, val(pr)      [or whatever]
> Next
> Is such a thing possible?
> Thanks,
> - Ian in Chicago



Sun, 16 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Iterating through the properties of an object?

2. Iterate through an object's properties (any object)

3. Iterating through properties of a VB com object at runtime

4. Iterating a form's property values

5. iterating database properties?

6. Iterate Properties on ContactItem

7. How to iterate through ContactItem properties?

8. Iterate through custom properties from VBA?

9. Q: Iterate a controls properties at runtime?

10. Iterating through class properties?

11. Iterate through a hashtable, a get an object by Position

12. Iterate through object fields recursively

 

 
Powered by phpBB® Forum Software