Article ID: 139043
Article Last Modified on 11/17/2000
Option Explicit
Function TestCustomProperty() As Boolean
On Local Error GoTo TestCustomPropertyErr
Dim dbs As Database, cnt As Container
Dim doc As Document, prp As Property
' Define Database object, Container and Document.
Set dbs = CurrentDb()
Set cnt = dbs.Containers!Databases
Set doc = cnt.Documents!UserDefined
' Refresh the Document object.
doc.Properties.Refresh
Set prp = dbs.CreateProperty("MyProp", dbText, "Test")
doc.Properties.Append prp
TestCustomProperty = True
MsgBox "Created Custom Property [MyProp=Test]"
TestCustomPropertyEnd:
Exit Function
TestCustomPropertyErr:
MsgBox Error$
Resume TestCustomPropertyEnd
End Function
? TestCustomProperty()
Keywords: kbinfo kbusage KB139043