[AccessD] printing properties

Michael R Mattys michael.mattys at adelphia.net
Fri Feb 28 12:57:00 CST 2003


Dave and Susan,

Most of my code is still in 97 format
so I just copy and pasted "DAO." in a
few wrong places - sorry about that.

Nice use of the code though, Dave.

Mike Mattys

----- Original Message ----- 
From: <davesharpe2 at cox.net>
To: <accessd at databaseadvisors.com>
Sent: Friday, February 28, 2003 11:51 AM
Subject: Re: Re: [AccessD] printing properties


> 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




More information about the AccessD mailing list