Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve all form details in a project

Status
Not open for further replies.

JumpStarter

Programmer
Joined
Apr 26, 2003
Messages
7
Location
IN
Hi All,

Is it possible that i can programatically get all forms (its properties and controls) that exist in a visual basic project.

Thanks in advance

 
Use the forms collection and then the controls collection within each instance of a form.

this is a vba example but replace userforms with forms and it should work
Code:
Dim frm As UserForm
Dim ctl As Control

For Each frm In UserForms
    For Each ctl In frm.Controls
      Debug.Print ctl.Name, ctl.Object
    Next ctl
Next frm


"I'm living so far beyond my income that we may almost be said to be living apart
 
Be aware however that the forms collection will only give you the forms that are currently loaded in memory - which is very unlikely to be all the forms in the project itself.

mmilan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top