'UPDATE TITLE BLOCK SHEET 1
ThisDrawing.ResourceFileName = "C:\Vault Explorer\Templates\PartsListDrawing.idw"
ThisDrawing.KeepExtraResources = False
Dim oDrawingDoc As Document = ThisApplication.ActiveDocument
'Update Styles
Dim i As Integer
For i = 1 To oDrawingDoc.StylesManager.Styles.Count
If oDrawingDoc.StylesManager.Styles.Item(i).UpToDate = False Then
oDrawingDoc.StylesManager.Styles.Item(i).UpdateFromGlobal
End If
Next
You could create a new drawing template with the parts list you want renamed as the default one. Since your not saving these changes it won't do any harm. Or you could update the styles like above, but then change the parts list using the code.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
'Look for partlist within drawing. End rule, if it doesn't exist.
'say there is a Partslist on the sheet.
Dim oPartslist As PartsList
oPartslist = oSheet.PartsLists(1)
If oSheet.PartsLists(1) IsNot Nothing Then
'set parts list to a specific style
oPartsList.Style = oDrawDoc.StylesManager.PartsListStyles.Item("SPIDERPARTSLIST")
End If
To export the bom there is a snippet for it that looks something like. Look at the snippet of you want another format.
'Get the Filename of the file without the extension
FileName = ThisDoc.FileName(False) 'without extension
'Sets the path and filename of where the Exported BOM should be saved
BOMFile = "C:\BOMs\" & FileName & ".xls"
'Exports the BOM to the desired location
ThisBOM.Export("Structured", BOMFile, kMicrosoftExcelFormat)
Hope this helps.