ProductCatalog.DeleteCategory

Ee785007.c++_on(en-US,CS.10).gifEe785007.vb_off(en-US,CS.10).gif

Use this method to delete a category from the Product Catalog System.

Definition

Sub DeleteCategory(strCategoryName As String)

Parameters

strCategoryName

A String that contains the name of the category to be deleted.

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 error that this method can return.

Constant Value Description
E_CAT_CATEGORY_DOESNT_EXIST &H8898001C The specified category did not exist.

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

Remarks

Any products or categories that existed in the deleted category, but not in another category, will be orphaned. Categories will become root categories and products will become root products. For example: CategoryA and CategoryB are child categories of CategoryX. CategoryA is also a child of CategoryY. When CategoryX is deleted, CategoryB will become a root category, but CategoryA will not.

If this category has been specified as a Pricing category for a custom catalog, it will be removed as the Pricing category. All the products using this category as a Pricing category will revert to their original price and the category will be removed as the Pricing category

Example

myProductCatalog.DeleteCategory "Apparel"

See Also

ProductCatalog Object

ProductCatalog.RootCategories

ProductCatalog.CreateCategory

ProductCatalog.GetCategory


All rights reserved.