[AccessD] printing properties

davesharpe2 at cox.net davesharpe2 at cox.net
Fri Feb 28 10:52:00 CST 2003


Michael -

Very interesting. 

I don't know how I'll use it yet, but it is a keeper.

I think there was a minor error in the DIMs.

Susan this can produce a great deal of info ( it
did in my development mdb ). You might want to 
Print to a file instead of Debug.print.

I've made modifications to Michael's code to
save the printed information and here it is.

Dave
============================================== 

Function GetContainerInfo() As String
    Dim dbs As DAO.Database
    Dim cnt As DAO.Container
    Dim Doc As DAO.Document
    Dim prp As DAO.Property
    Dim strPropName As String
    Dim strPropVal As String
    Dim I As Integer
    Dim J As Integer
    Dim k As Integer
    Dim FileNoToUse As Integer
    
    FileNoToUse = FreeFile
    Open "c:\container_data.txt" For Output As FileNoToUse
    
    Set dbs = CurrentDb
    For k = 0 To dbs.Containers.Count - 1
        Set cnt = dbs.Containers(k)
            For I = 0 To cnt.Documents.Count - 1
            Set Doc = cnt.Documents(I)
            Doc.Properties.Refresh
                For J = 0 To Doc.Properties.Count - 1
                    strPropName = Doc.Properties(J).Name
                    strPropVal = Doc.Properties(J).Value
                    Print #FileNoToUse, strPropName & " = " & strPropVal
                Next
                Print #FileNoToUse, vbCrLf
            Next
    Next
    Set Doc = Nothing
    Set cnt = Nothing
    Close
End Function



==============================================
> 
> From: "Michael R Mattys" <michael.mattys at adelphia.net>
> Date: 2003/02/27 Thu PM 09:52:02 EST
> To: <accessd at databaseadvisors.com>
> Subject: Re: [AccessD] printing properties
> 
> Susan,
> 
> Here's one for all containers:
> 
> Function GetContainerInfo() As String
>     Dim dbs As DAO.Database, cnt As DAO.Container
>     Dim DAO.Doc As Document, DAO.prp As Property
>     Dim strPropName As String, strPropVal As String, I As Integer, J As
> Integer, k As Integer
>     Set dbs = CurrentDb
>     For k = 0 To dbs.Containers.Count - 1
>         Set cnt = dbs.Containers(k)
>             For I = 0 To cnt.Documents.Count - 1
>             Set Doc = cnt.Documents(I)
>             Doc.Properties.Refresh
>                 For J = 0 To Doc.Properties.Count - 1
>                     strPropName = Doc.Properties(J).Name
>                     strPropVal = Doc.Properties(J).Value
>                     Debug.Print strPropName & " = " & strPropVal
>                 Next
>                 Debug.Print vbCrLf
>             Next
>     Next
>     Set Doc = Nothing
>     Set cnt = Nothing
> End Function
> 
> Mike Mattys
> 
> ----- Original Message -----
> From: "Susan Harkins" <harkins at iglou.com>
> To: <accessd at databaseadvisors.com>
> Sent: Thursday, February 27, 2003 9:34 PM
> Subject: Re: [AccessD] printing properties
> 
> 
> >
> >
> > > Do you mean a container's properties?  Or the properties of the item in
> > > the collection?  Collections are pretty hard up for properties.  An
> > > individual Printer has a whole bunch of them though, but I don't know of
> > > a way to enum them unless you could do something tricky with an
> > > AccessObject.
> > >
> > ========I want both. I want it all! ;)
> >
> > Susan H.
> >
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list