Category.AddProduct
Use this method to add the specified product to this category.
Definition
Sub AddProduct(varProductID As Variant)
Parameters
varProductID
A Variant that contains the of the product to be added.
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_PRODUCT_DOESNT_EXIST | &H8898001E | The specified product did not exist in the catalog. |
E_CAT_PRODUCT_ALREADY_ADDED | &H88980029 | The specified product was already in this category. |
Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
A product may exist in multiple categories simultaneously, without limit.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
Example
myCategory.AddProduct "SKU4005"