Opening new document in with macros
Opening new document in with macros
(OP)
I want to open a new part document with my macro. The code involved in opening a new document requires me to know the location of the template:
Set Part = swApp.NewDocument("C:\Documents and Settings\All Users\Application Data\SolidWorks\templates\Part.prtdoc", 0, 0#, 0#)
Of course, I don't know if this will be the path to the template on another computer. Is there a way to find the template file path? Any help would be appreciated.
Set Part = swApp.NewDocument("C:\Documents and Settings\All Users\Application Data\SolidWorks\templates\Part.prtdoc", 0, 0#, 0#)
Of course, I don't know if this will be the path to the template on another computer. Is there a way to find the template file path? Any help would be appreciated.






RE: Opening new document in with macros
-handleman, CSWP (The new, easy test)
RE: Opening new document in with macros
Dim template As String
template = swApp.GetUserPreferenceStringValue(swUserPreferenceStringValue_e.swDefaultTemplatePart)
Set Part = swApp.NewDocument(template, 0, 0#, 0#)