Best way is to build this table yourself (compute BOM) rather than relay on pre-built named BOM. Take a look at the following examples which may help:
#CODE|Count Components - to get all components and calculate the quantity
2013 SOLIDWORKS API Help - Traverse Assembly at Component and Feature Level Example (VBA) - to get the component in hierarchical order.
2014 SOLIDWORKS API Help - Get Custom Properties for Configuration Example (VBA) - to get custom proeprties