Share via


CatalogManager.AddDefinitionVariantProperty

Ee799167.c++_on(en-US,CS.10).gifEe799167.vb_off(en-US,CS.10).gif

Use this method to add a variant property to a definition. This method is similar to the AddDefinitionProperty method. The properties added with this method will only be used by product variants.

Definition

Sub AddDefinitionVariantProperty(strDefinitionName As String,strPropertyName As String)

Parameters

strDefinitionName

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

strPropertyName

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

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 variant property to a definition. Any product variants 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.AddDefinitionVariantProperty "T-Shirts", "Size"

See Also

CatalogManager Object

CatalogManager.AddDefinitionProperty

CatalogManager.RemoveDefinitionProperty


All rights reserved.