Dim swCustPropMgr As SldWorks.CustomPropertyManager
Dim swApp As SldWorks.SldWorks
Dim swSheetMetal As ISheetMetalFeatureData
Dim swModel As SldWorks.ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
If Not swModel Is Nothing Then
swFileName = swModel.GetTitle
Dim vDescription As String
Dim sDescription() As String
sECN = InputBox("Please Enter the ECN for this Project Release")
If Right(UCase$(Response), 7) = swDocType Then
Set swModel = swApp.OpenDoc6(Response, 1, 0, "", longstatus, longwarnings)
Set swModel = swApp.ActiveDoc
swFileName = swModel.GetTitle
sPartNo = Split(swFileName, " ")(0)
sDescription() = Split(Replace(swFileName, " ", delimiter, 1, 1), delimiter)
vDescription = Split(sDescription(1), ".")(0)
sFinish = Right(Split(swFileName, " ")(0), 2)
Set swCustPropMgr = swModel.Extension.CustomPropertyManager(Empty)
swCustPropMgr.Add3 "PartNo", swCustomInfoText, sPartNo, 0
swCustPropMgr.Add3 "Description", swCustomInfoText, vDescription, 0
swCustPropMgr.Add3 "Finish", swCustomInfoText, sFinish, 0
swCustPropMgr.Add3 "Author", swCustomInfoText, "MA", 0
swCustPropMgr.Add3 "ECN", swCustomInfoText, sECN, 0
swCustPropMgr.Add3 "PartNo", swCustomInfoText, sPartNo, 2
swCustPropMgr.Add3 "Description", swCustomInfoText, vDescription, 2
swCustPropMgr.Add3 "Finish", swCustomInfoText, sFinish, 2
swCustPropMgr.Add3 "Author", swCustomInfoText, "MA", 2
swCustPropMgr.Add3 "ECN", swCustomInfoText, sECN, 2
swApp.CloseDoc (Response)
MsgBox "Please open part or assembly"