CreatePropertyByPosition Method

Creates a new shared property identified by a numeric index that's unique within the property group. If a shared property with the specified index already exists, CreatePropertyByPosition returns a reference to the existing one.

Applies To

SharedPropertyGroup Object

Syntax

Set property = propertygroup.CreatePropertyByPosition (index, fExists)

Parameters

property
An object variable that evaluates to a SharedProperty object.

propertygroup
An object variable that represents the SharedPropertyGroup to which the new SharedProperty object will belong.

index
A Long value that represents the numeric index within the SharedPropertyGroup by which the new property will be referenced. You can use this index later to retrieve the shared property with PropertyByPosition.

fExists
A Boolean value. If fExists is set to True on return from this method, the shared property specified by index existed prior to this call. If it's set to False, the property was created by this call.

Remarks

When you create a shared property, its value is set to the default, which is 0.

If you create a SharedProperty object with the CreatePropertyByPosition method, you can access that property only by using PropertyByPosition. You can't assign a string name to the same property and then access it by using Property. Accessing a property by position is faster than accessing a property by using a string name because it requires less overhead.

The same shared property group can contain some SharedProperty objects that are identified by position and others that are identified by name.

Example

See Also

Sharing State, ISharedPropertyGroup::CreateProperty Method, ISharedPropertyGroup::get_PropertyByPosition Method, ISharedPropertyGroup::get_Property Method