G
GS
I am unable to read the description for a macro even though I see it
in the application. I am using the Northwind mdb which installed with
access 2003.
I can read the Name, DateCreated, and DateModified without a problem,
but can't read the description. I have tried:
1. srtrDesc = obj.Properties("Description").Value /
obj.Properties.Item("Description").Value Which generates the
following error: You entered an expression that has an invalid
reference to the property 'Description'
I tried iterating through the properties collection for the macro
object and discoved there were no properties present in the
collection. The count was 0.
2. strDesc = app.CurrentDb.Containers("Macros").Documents(strName).Properties("Description").Value
Which generates the following error: Item not found in collection
error.
I have seen reported problems where the Description property is not
added until it is first used, but in this case I can see the
descriptions for the macros through the application, I just can't read
them through code.
My code is as follows:
<CODE>
Set app = New Access.Application
app.OpenCurrentDatabase strDB 'Local northwind mdb
app.Visible = False
'process Macros
For Each obj In app.CurrentProject.AllMacros
strName = obj.Name
Debug.Print strName
strDesc = app.CurrentDb.Containers("Macros").Documents(strName).Properties("Description").Value
Debug.Print strDesc
strModified = obj.DateModified
Debug.Print strModified
strCreated = obj.DateCreated
Debug.Print strCreated
Next obj
</CODE>
in the application. I am using the Northwind mdb which installed with
access 2003.
I can read the Name, DateCreated, and DateModified without a problem,
but can't read the description. I have tried:
1. srtrDesc = obj.Properties("Description").Value /
obj.Properties.Item("Description").Value Which generates the
following error: You entered an expression that has an invalid
reference to the property 'Description'
I tried iterating through the properties collection for the macro
object and discoved there were no properties present in the
collection. The count was 0.
2. strDesc = app.CurrentDb.Containers("Macros").Documents(strName).Properties("Description").Value
Which generates the following error: Item not found in collection
error.
I have seen reported problems where the Description property is not
added until it is first used, but in this case I can see the
descriptions for the macros through the application, I just can't read
them through code.
My code is as follows:
<CODE>
Set app = New Access.Application
app.OpenCurrentDatabase strDB 'Local northwind mdb
app.Visible = False
'process Macros
For Each obj In app.CurrentProject.AllMacros
strName = obj.Name
Debug.Print strName
strDesc = app.CurrentDb.Containers("Macros").Documents(strName).Properties("Description").Value
Debug.Print strDesc
strModified = obj.DateModified
Debug.Print strModified
strCreated = obj.DateCreated
Debug.Print strCreated
Next obj
</CODE>