Sub Main
tempFile = DefaultFilePath & "\pick_and_place.txt"
Open tempFile For Output As #1
tempS = ""
'Output table header
For i = 0 to UBound(Columns)
Print #1, Columns(i);
Print #1, COMMA;
Next
Print #1
'Output table rows
For Each part in ActiveDocument.Components
Print #1, part.Name;
Print #1, COMMA;
Print #1, part.PartType;
Print #1, COMMA;
Print #1, part.Decal;
Print #1, COMMA;
tempS = ""
For Each attr In part.Attributes
If attr.Name = "Value" Then
If TypeName(attr.value) = "String" Then
tempS = attr.value
End If
End If