AnsweredAssumed Answered

PDF Macro to a specific folder

Question asked by Rhys Gardner on Jul 22, 2020
Latest reply on Jul 22, 2020 by Zhen Wei Tee

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!