Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Listing properties

I am looking for something to help with my documentation that I can use to
cycle through the controls on a User Form and list the properties of that
control.

When I read about Properties collection in Help, it appears that only
applies to SmartTags.

I know how to get the value of a property, but I don't want to have to enter
name of every property of each control. I'm looking for something that can
count the number of propeties for that particular control and then list them
and their value out. This is what I have:

Sub ListProps()
Dim intFormCount As Integer, intCounter As Integer

intFormCount = frmMyForm.Controls.Count
For intCounter = 0 To intFormCount - 1
With frmMyForm.Controls(intCounter)
Debug.Print .Name & vbtab & .Font
End With

Next

End Sub

This is what I need:

Sub ListProps()
Dim intFormCount As Integer, intProp As Integer, intCounter As Integer

intFormCount = frmMyForm.Controls.Count
For intCounter = 0 To intFormCount - 1
With frmMyForm.Controls(intCounter)
For intProp=1 to .Properties.Count
Debug.Print .Properties(intProp).Name & vbtab & .Properties(intProp).Value
Next
End With

Next
End Sub


Except that Properties only applies to SmartTags.

Any bright ideas out there?

Many thanks

Janie

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Listing properties

In theory you could use Dim ... as object which should allow you to query /
list any child properties; but then you have to be aware that there's
recursion in the object model you're interrogating which would be non-trivial
because of the problems testing it.

That said, I'm not sure that what you are trying to do is actually what you
want to achieve. What you seem to want isn't really documentation, more just
be a print out of a code listing that would be useless to someone who may
have to maintain the code later as they'd just read it from the project/code
in front of them.

If you just want a listing, you'd be better off exporting your userform and
code modules (I *think* you can do that programmatically) and extract what
you want from there as the exported files are only text files.



"Janie" wrote:

I am looking for something to help with my documentation that I can use to
cycle through the controls on a User Form and list the properties of that
control.

When I read about Properties collection in Help, it appears that only
applies to SmartTags.

I know how to get the value of a property, but I don't want to have to enter
name of every property of each control. I'm looking for something that can
count the number of propeties for that particular control and then list them
and their value out. This is what I have:

Sub ListProps()
Dim intFormCount As Integer, intCounter As Integer

intFormCount = frmMyForm.Controls.Count
For intCounter = 0 To intFormCount - 1
With frmMyForm.Controls(intCounter)
Debug.Print .Name & vbtab & .Font
End With

Next

End Sub

This is what I need:

Sub ListProps()
Dim intFormCount As Integer, intProp As Integer, intCounter As Integer

intFormCount = frmMyForm.Controls.Count
For intCounter = 0 To intFormCount - 1
With frmMyForm.Controls(intCounter)
For intProp=1 to .Properties.Count
Debug.Print .Properties(intProp).Name & vbtab & .Properties(intProp).Value
Next
End With

Next
End Sub


Except that Properties only applies to SmartTags.

Any bright ideas out there?

Many thanks

Janie

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing newguyA14 Excel Programming 1 April 21st 07 01:09 AM
Properties transferring from excel cells to word file properties lubo Excel Programming 4 July 12th 05 11:24 AM
how do I set up a listing of rental properties and various info o. itsme0715 New Users to Excel 1 January 30th 05 06:07 AM
Listing of one cell controlling the listing of another cell. peijuan Excel Programming 0 August 8th 04 03:17 AM
Where do I find the listing of the differnt methods, properties etc used by VBA? Phillips Excel Programming 1 December 9th 03 11:42 AM


All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"