- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
Wondering if someone could help me with this:
I want to copy just a part of a part name to description field in iProperties.
ex. I save a part with name: 123A001 Motor Assy for example
After save the part number will be "123A001 Motor Assy" in iProperties
I want to cut "Motor Assy" and paste it to description field as following:
Part Number: 123A001
Description: Motor Assy
I manage to copy the whole part name to Description field with following code:
Sub Main()
' Get the active document.
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
' Get the PropertySets object.
Dim oPropSets As PropertySets
Set oPropSets = oDoc.PropertySets
' Get the design tracking property set.
Dim oPropSet As PropertySet
Set oPropSet = oPropSets.Item("Design Tracking Properties")
' Get the part number iProperty.
Dim oPartNum_iProp As Property
Set oPartNum_iProp = oPropSet.Item("Part Number")
' Get the description iProperty.
Dim oDesc_iProp As Property
Set oDesc_iProp = oPropSet.Item("Description")
' Copy part number to description
oDesc_iProp.Value = oPartNum_iProp.Value
End Sub
...but I can't figure out how to cut the describing text.
FYI there is always space between the partnumber and describing text so maybe that can be used as a separator, however it can also be space in the describing text...
Any one?
/ Jorgen
Solved! Go to Solution.