A family of Microsoft word processing software products for creating web, email, and print documents.
Try:
ActiveDocument.SaveAs FileName:=filePath, FileFormat:=wdFormatPDF, AddToRecentFiles:=False
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The cide fr the Macro is :
4 Save as a PDF and Open
Sub SaveAsPDFAndOpen()
Dim Terms As String
Dim number As String
Dim office As String
Dim filePath As String
' Get the content of the bookmarks
Terms = ActiveDocument.Bookmarks("Terms").Range.Text
number = ActiveDocument.Bookmarks("Number").Range.Text
' Construct the file path
filePath = " G:\Shared drives\AuSIL Bookshop\Invoices-Receipts\Darwin Invoices" & "_" & number & "_" & Terms & ".pdf"
' Save the document as PDF
ActiveDocument.ExportAsFixedFormat _
OutputFileName:=filePath, _
ExportFormat:=wdExportFormatPDF
' Open the PDF file
Shell "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe """ & filePath & """", vbNormalFocus
End Sub
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Try:
ActiveDocument.SaveAs FileName:=filePath, FileFormat:=wdFormatPDF, AddToRecentFiles:=False