Clicking a button to save activedocument as a PDF to a specific location

Viewed 27

I am trying to make it so that when a button is clicked it saves the document to a specific location on the computer. The code I currently have opens it after it exports it as a pdf but it does not show up in the folder.

Private Sub CommandButton1_Click()

'Define File Path
sFilePath = "Filep Path Name"
    
'Export as PDF
ActiveDocument.ExportAsFixedFormat _
    outputfilename:=sFilePath, _
    exportformat:=wdExportFormatPDF, _
    openafterexport:=True

End Sub

I am unsure as to why it is not going into the folder.

Thanks

0 Answers
Related