Share via


CatalogManager.AddDefinitionProperty

Ee824949.c++_on(en-US,CS.10).gifEe824949.vb_off(en-US,CS.10).gif

Use this method to add an existing property to an existing category or product definition.

Definition

Sub AddDefinitionProperty(strDefinitionName As String,strPropertyName As String)

Parameters

strDefinitionName

A String that contains the name of the definition to which the property will be added.

strPropertyName

A String that contains the name of the property.

Return Values

None.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_CAT_DEFINITION_DOESNT_EXIST &H8898000B The specified definition did not exist.
E_CAT_PROP_DOESNT_EXIST &H88980005 The specified property did not exist.
E_CAT_PROP_IN_DEFINITION &H8898000D The specified property was already in the definition.
OLE_E_BLANK &H80040007 The object was not initialized. The Initialize method must be called before calling any other method.

Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

This method adds a property to a definition. Any products or categories created from the definition will also have the property. A property can only be added to a definition once. A property cannot be used in a product definition as both a property and a variant property.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

myCatalogManager.AddDefinitionProperty "Printers", "Manufacturer"

See Also

CatalogManager Object

CatalogManager.AddDefinitionVariantProperty

CatalogManager.RemoveDefinitionProperty


All rights reserved.