' Set a reference to the component definition.
Dim oCompDef As PartComponentDefinition
Set oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
' Make sure we have an iPart factory.
If oCompDef.IsiPartFactory = False Then
MsgBox "Chosen document is not a factory.", vbExclamation
Exit Sub
End If
' Set a reference to the factory.
Dim oiPartFactory As iPartFactory
Set oiPartFactory = oCompDef.iPartFactory
' Get the cell value of rows in the factory.
Dim iNumRows As Integer
For iNumRows = 1 To oiPartFactory.TableRows.Count
MsgBox oiPartFactory.TableColumns(1).Item(iNumRows).value
Next