Sub AddProgerty
DefineProperty "SchemaPath","user","extendionID","string", False, , True
end Sub
Function DefineProperty( _
ByVal AppSchemaFld As String, _
ByVal Namespace As String, _
ByVal PropertyName As String, _
Optional DataType As String = "string", _
Optional IsMultiValued As Boolean = False, _
Optional Default As String = "", _
Optional IsIndexed As Boolean = False)
' This function creates a property definition
' in an application schema folder. The default
' is to create a single-valued, string property
' that has no default value and is not indexed.
' If you are using VBScript, use this With:
' With CreateObject("ADODB.Record")
With New ADODB.Record
' Create the new property record
.Open AppSchemaFld & Replace(Namespace, ":", "-") & PropertyName _
, _
, adModeReadWrite _
, adCreateNonCollection + adCreateOverwrite
' Define the property
.Fields _
("DAV:contentclass") _
= "urn:content-classes:propertydef"
.Fields _
("urn:schemas-microsoft-com:xml-data#name") _
= Namespace & PropertyName
.Fields _
("urn:schemas-microsoft-com:datatypes#type") _
= DataType
.Fields _
("urn:schemas-microsoft-com:exch-data:ismultivalued") _
= IsMultiValued
.Fields _
("urn:schemas-microsoft-com:exch-data:defaultvalue") _
= Default
.Fields _
("urn:schemas-microsoft-com:exch-data:isindexed") _
= IsIndexed
' Save the changes
.Fields.Update
.Close
End With
End Function