Hi guys, i'm wondering if this macro could be adjusted to so the macro saves the PDF to a specific location (defined in code) rather than the location of the source file?
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim FilePath As String
Dim PathSize As Long
Dim PathNoExtention As String
Dim NewFilePath As String
FilePath = Part.GetPathName
PathSize = Strings.Len(FilePath)
PathNoExtention = Strings.Left(FilePath, PathSize - 6)
NewFilePath = PathNoExtention & "pdf"
Part.SaveAs2 NewFilePath, 0, True, False
MsgBox "Saved " & NewFilePath
End Sub
Any direction would be greatly appreciated!
RG
Try replace your code
with the following code (You need to change the folder path in red)
I had not tried it out, but it should work.