Capture Documenter output under program control 
Author Message
 Capture Documenter output under program control

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?



Sat, 05 Jul 2003 04:57:36 GMT  
 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?



Sat, 05 Jul 2003 05:24:12 GMT  
 Capture Documenter output under program control
I have tried your suggestion, and while it produces a good deal of output, it
doesn't produce what interests me most. What I need is to capture the code in
event handlers and in the general section (non-event subroutines and functions).
Have you any thoughts on this?
Quote:
-----Original Message-----
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?

.



Sat, 05 Jul 2003 21:25:36 GMT  
 Capture Documenter output under program control
I haven't done this, but you should be able to get a reference to the
object's Module property (if it has one), and then work with the methods and
properties of a Module object.  Something like this:

'---- start of "air code" ----
Dim frm As Form
Dim mdl As Module

'... assume code has set frm to refer to form opened in design view

If frm.HasModule Then
    Set mdl = frm.Module
    With mdl
        '... code working with properties of Module object mdl
    End With
End If
'---- end of "air code" ----

--

Dirk Goldgar
(remove NOSPAM from reply address)


I have tried your suggestion, and while it produces a good deal of output,
it
doesn't produce what interests me most. What I need is to capture the code
in
event handlers and in the general section (non-event subroutines and
functions).
Have you any thoughts on this?

Quote:
-----Original Message-----
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?

.



Sun, 06 Jul 2003 01:37:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Capture output from command line program

2. How to Capture Dos Output in VB4 Program (HELP)

3. How do I capture other programs print output

4. Running program and capturing output

5. Capture output from command line program

6. capturing the output of an MSDOS program

7. Capturing output from a shelled MS-DOS program

8. Capture output a DOS based program?

9. Need control to display output of running program

10. Need control to display output of running program

11. Capturing DOS box output in VB/Win

12. Capture Dos DIR command outputs for VB

 

 
Powered by phpBB® Forum Software