- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
H i need to change the heading of partlist collumn heading via ilogic or vba. Anybody can help?
by
karthikeyan M
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
The Following code could full fill your requirement.
Sub Edit_Column_name()
Dim oDoc As Document
Dim oSheet As Sheet
Dim oPartsList As PartsList
Dim oPartsListColumn As PartsListColumn
Dim oColumnName As String
Dim oName As String
Set oDoc = ThisApplication.ActiveDocument
If oDoc.DocumentType = kDrawingDocumentObject Then
Set oSheet = oDoc.ActiveSheet
oSheet.Activate
For Each oPartsList In oSheet.PartsLists
For Each oPartsListColumn In oPartsList.PartsListColumns
oColumnName = oPartsListColumn.Title
oName = InputBox("Enter the new name for the Column : " + oColumnName + "", "Enter Column Name")
If oName <> "" Then
oPartsListColumn.Title = oName
End If
Next
Next
Else
MsgBox "The Selected document is not a drawing document please select a drawing document and continue", vbOKOnly, "Edit Column Name"
Exit Sub
End If
End Sub
If this information was helpful, please consider marking it as an Accepted Solution by using the Accept as Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Sub Edit_Column_name()
Dim oDoc As Document
Dim oSheet As Sheet
Dim oPartslist As PartsList
Dim oPartsListColumn As PartsListColumn
Dim oColumnName As String
Dim oName As String
Set oDoc = ThisApplication.ActiveDocument
If oDoc.DocumentType = kDrawingDocumentObject Then
Set oSheet = oDoc.ActiveSheet
oSheet.Activate
Set oPartslist = oSheet.PartsLists(1)
For Each oPartsListColumn In oPartslist.PartsListColumns
oColumnName = oPartsListColumn.Title
If oColumnName = "Qty" Then '
oName = "Length"
oPartsListColumn.Title = oName
End If
Next
Else
MsgBox "The Selected document is not a drawing document please select a drawing document and continue", vbOKOnly, "Edit Column Name"
Exit Sub
End If
End Sub
Thanks its working
-karthikeyan M