Hi All,
I have pieced together a process to save as PDF and to rename the PDF. I am hoping extend the process and to add a cover page (PDF) to the produced PDF. So I am hoping to to have a button to:
1. Create PDF from current word doc
2. Rename the PDF
3. Grab a PDF in a separate file location to put in front of my current word doc/PDF
4. Save the file as Step 2 name
I haven't posted questions in a while so please let me know if I am breaking forum rules at anytime in the feed.
Thanks!
I have pieced together a process to save as PDF and to rename the PDF. I am hoping extend the process and to add a cover page (PDF) to the produced PDF. So I am hoping to to have a button to:
1. Create PDF from current word doc
2. Rename the PDF
3. Grab a PDF in a separate file location to put in front of my current word doc/PDF
4. Save the file as Step 2 name
VBA Code:
Sub MacroSaveAsPDF()
Dim strPath As String
Dim strPDFname As String
strPDFname = InputBox("Enter name for PDF", "File Name", "2023 Final Pre-Roll Report -")
If strPDFname = "" Then
strPDFname = "2023 Final Pre-Roll Report -"
End If
strPath = ActiveDocument.Path
If strPath = "" Then
strPath = Options.DefaultFilePath(wdDocumentsPath) & Application.PathSeparator
Else
strPath = strPath & Application.PathSeparator
End If
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
strPath & strPDFname & ".pdf", _
ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=False, _
OptimizeFor:=wdExportOptimizeForPrint, _
Range:=wdExportAllDocument, _
IncludeDocProps:=True, _
CreateBookmarks:=wdExportCreateWordBookmarks, _
BitmapMissingFonts:=True
End Sub
I haven't posted questions in a while so please let me know if I am breaking forum rules at anytime in the feed.
Thanks!