Read a BOM table from DocumentManager API

How can I read the contents of a BOM on the drawing using the swDocumentmgr?

I am using .NET and I am able to GetTableNames. In the example below, I know the table that I want to get the information from is called "Bill of Materials2" This returns the ISwDMTable object with the Name="Bill of Materials2". How do I get the data that is in the table such as item number, quantity, part number, etc?

       

        Dim value As Object

        Dim value2 As ISwDMTable

          swDoc = DirectCast(swDocMgr.GetDocument(sDocFileName, GetDocType(sDocFileName), False, nRetVal), SwDMDocument15)

        If (GetDocType(sDocFileName) <> SwDmDocumentType.swDmDocumentDrawing) Then

            MsgBox(swDoc.GetComponentCount, MsgBoxStyle.Information, "Number of Components")

        Else

            MsgBox("Its a drawing", MsgBoxStyle.Information, "Information Dialog")

            value = swDoc.GetTableNames(2)

            value2 = swDoc.GetTable("Bill of Materials2")

        End If

Thanks

Craig

SolidworksApi macros