
Capture Documenter output under program control
Of course, you can save the Documenter output as a table or output it to a
text file. Aside from that, you can get at the properties of all forms and
reports by accessing the objects in the Forms or Reports document
containers, opening each in Design view, extracting the properties you want,
and then closing it. Code to examine all forms might look something like
this:
'---- start of VBA code ----
Sub subExamineAllForms()
Dim db As DAO.Database
Dim cnt As DAO.Container
Dim doc As DAO.Document
Dim frm As Form
Dim prp As DAO.Property
Dim ctl As Control
Set db = CurrentDb
Set cnt = db.Containers!Forms
cnt.Documents.Refresh
For Each doc In cnt.Documents
DoCmd.OpenForm doc.Name, acDesign
Set frm = Forms(doc.Name)
Debug.Print "*** Form [" & frm.Name & "]"
For Each prp In frm.Properties
With prp
Debug.Print .Name; " : Type=" & .Type & ", Value=" & .Value
End With
Next prp
DoCmd.Close acForm, frm.Name, acSaveNo
Next doc
Set frm = Nothing
Set cnt = Nothing
Set db = Nothing
End Sub
'---- end of VBA code ----
--
Dirk Goldgar
(remove NOSPAM from reply address)
I'm working on a project in VB to document an Access database. I have
managed to
extract all the data I want from QueryDefs and TableDefs using DAO and I've
been
able to extract module information as well, but I'm having trouble with
Forms and
Reports.
Documenter can extract this data, but I can't find a way to do this under VB
control. The data appear to be available once you open a form or a report,
but if
you check the count property of the Forms or Reports collection, you get
only a
count of the open forms or reports. I need a programmatic way of determining
the
names of the not-yet-open objects so I can open them and extract what I
need.
Anyone ever done anything like this?