Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a idw file with 50 Nos. of sheets. Every sheet there is a part list which is ununiform. i want to edit the part list collumn width via vab. i already have revision table width program. i'm attaching that for your reference.
Sub Change_Revision_table_width() Dim oDoc As Document Dim oSheet As Sheet Dim oRevisionTables As RevisionTable Dim oRevisionTableColumn As RevisionTableColumn Dim oColumnName As String Dim oWidth As Double Set oDoc = ThisApplication.ActiveDocument If oDoc.DocumentType = kDrawingDocumentObject Then Set oSheet = oDoc.ActiveSheet oSheet.Activate For Each oRevisionTables In oSheet.RevisionTables For Each oRevisionTableColumn In oRevisionTables.RevisionTableColumns oColumnName = oRevisionTableColumn.Title If oColumnName = "Rev." Then ' <--- You Can change the column name in here to what ever column you need oRevWidth = ".8" oRevisionTableColumn.Width = oRevWidth End If If oColumnName = "Cpy Rev" Then ' <--- You Can change the column name in here to what ever column you need oCpyRevWidth = "1.2" oRevisionTableColumn.Width = oCpyRevWidth End If If oColumnName = "Status" Then ' <--- You Can change the column name in here to what ever column you need oStatusWidth = "1.8" oRevisionTableColumn.Width = oStatusWidth End If If oColumnName = "Rev. Date" Then ' <--- You Can change the column name in here to what ever column you need oRevDateWidth = "1.8" oRevisionTableColumn.Width = oRevDateWidth End If If oColumnName = "Revision Description" Then ' <--- You Can change the column name in here to what ever column you need oRevDesWidth = "4.4" oRevisionTableColumn.Width = oRevDesWidth End If If oColumnName = "Issued by" Then ' <--- You Can change the column name in here to what ever column you need oIssuedWidth = "2.0" oRevisionTableColumn.Width = oIssuedWidth End If If oColumnName = "Reviewed by" Then ' <--- You Can change the column name in here to what ever column you need oReviewedWidth = "2.0" oRevisionTableColumn.Width = oReviewedWidth End If If oColumnName = "Appr. ENG" Then ' <--- You Can change the column name in here to what ever column you need oApprWidth = "2.0" oRevisionTableColumn.Width = oApprWidth End If If oColumnName = "Appr. PMT/OPS" Then ' <--- You Can change the column name in here to what ever column you need oApprPMTWidth = "2.0" oRevisionTableColumn.Width = oApprPMTWidth End If If oColumnName = "Part. Accept." Then ' <--- You Can change the column name in here to what ever column you need oPartaccWidth = "2.0" oRevisionTableColumn.Width = oPartaccWidth End If Next Next Else MsgBox "The Selected document is not a drawing document please select a drawing document and continue", vbOKOnly, "Edit Revision Table Column Width:" Exit Sub End If End Sub
Thank you,
Regards,
karthikeyan M
+91-9894814348
Solved! Go to Solution.