Working with Root Categories

If you pass an empty string to the GetCategory method of the ProductCatalog object, the Category object is exposed as a root category. This allows you to call some of the methods of the Category object as if you are calling them on the catalog. The following snippet shows how you can page through the root products in a catalog:

Set oProductCatalog = oCatalogManager.GetCatalog(“mycatalog”)
‘ Get the root category
Set oCategory = oProductCatalog.GetCategory(“”)
‘ Now get 10 products and product families starting from the 10th root product
Set oRs = oCategory.Products(12,”Name”,10,10, NumRootProducts)
‘ This call will return all products and variants in your catalog
Set oRs = oCategory. DescendantProducts(14,1, , NumRootProducts)

You can call the following methods on the root category:

  • CatalogName
  • CategoryName
  • ChildCategories
  • Products
  • DescendantProducts
  • Search

Copyright © 2005 Microsoft Corporation.
All rights reserved.