[URL unfurl="true"]http://www.greggriffiths.org/livelink/development/lapi/catAttWhatHaveYou/[/URL]
in that piece of code see how I use the CATEGORYSUBTYPE
in your case it would be the foldersubtype.Check the lapi docs for what those constants are.
status =doc.CreateObjectEx( volumeID, objectID, LAPI_DOCUMENTS.OBJECTTYPE, LAPI_DOCUMENTS.CATEGORYSUBTYPE, catName,