I am very new to VB programming and will really appreciate if someone can help.
1. A user presses save or (ctrl-s) in either part, assembly or drawing.
2. It runs a macro which extracts the properties from filename.
3. Macro should also run when the autosave kicks in for either part, assembly or drawing
Requirements: User should not be required to run the macro
To run the macro when a save event is fired, I tried following from Amen Allah Jlili, Deepak Gupta, Wayne Matus and @Tobin_Sparks. But, I cannot understand the code and hence dont know what to change.
Will appreciate if someone can put sample code.
Deepak gupta and Wayne Matus : https://forum.solidworks.com/thread/21658#88655
Tobin sparks: PreSave
Dim swApp As SldWorks.SldWorks
Dim swModel As ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
swModel.AddCustomInfo2 "PartNo", swCustomInfoText, Left(swModel.GetTitle, 6)
swModel.AddCustomInfo2 "Rev", swCustomInfoText, Mid(swModel.GetTitle, 8, 1)
swModel.AddCustomInfo2 "Title", swCustomInfoText, Mid(swModel.GetTitle, 10, 50)
Thank you in advance.