Macro to associate BOM with Sheet Number

Hi,

Does anyone know of a way to find what sheet of a multi-sheet drawing a BOM resides on?  This seems like it should be easy, but after searching forums and the API help, it doesn't appear to be as simple as I thought. 

I have a macro that cycles through each sheet in a multi-sheet drawing, saves the BOM out of each sheet to Excel, and saves the drawing sheet to PDF.  It would help simplify my code if I could determine which sheet the BOM resides on, since I could then just cycle through the drawing sheet by sheet.  Plus, I want to know if there is a way to do this just because I'm curious if it can be done.

BOMs seem to be treated as "features" that can be cycled through in the feature tree using getnextfeature.  My code uses getfirstfeature...getnextfeature to extract the BOMs for now.  My problem is that I don't care about where they are in the feature tree; I care about what sheet they're on, and there seems to be no property in the BOM feature that contains this information.

The code is pretty messy, but I attached it for reference.  My job is to go through and clean it up, hence this question.  Any help is appreciated.

SolidworksApi macros