Shortcut to Save as a PDF

by Allen Wyatt
(last updated July 29, 2017)

4

In Mary's office they routinely create PDF files from Word documents. They do this by using Save As and choosing to save the document as a PDF file. This seems rather "click intensive" to Mary, so she wonders if there is a shortcut available, within Word, for saving a document as a PDF file.

There are two ways that you can approach this task. First, you could add a command to Quick Access Toolbar:

  1. Display the Word Options dialog box. (In Word 2007 click the Office button and then click Word Options. In Word 2010 and later versions display the File tab of the ribbon and then click Options.)
  2. Select the Customize option (Word 2007) or Quick Access Toolbar option (Word 2010 and later versions) at the left side of the dialog box.
  3. Using the Choose Commands From drop-down list, choose File Tab. This displays all of the commands that are on the File tab of the ribbon. (See Figure 1.)
  4. Figure 1. Adding a command to the Quick Access Toolbar.

  5. Scroll through the list of available commands and choose Publish As PDF or XPS.
  6. Click the Add button. The command is moved to the list at the right of the dialog box.
  7. Click OK. The new command now appears on the Quick Access Toolbar.

This tool, when clicked, displays a dialog box that looks very much like a Save As dialog box. All you'll need to do is to provide the name you want used for the PDF file and, optionally, pick a folder where you want the file saved.

You can take a similar approach through the use of a macro, if desired. The difference is that this approach actually does display the Save As dialog box.

Sub SaveAsPDF1()
    With Dialogs(wdDialogFileSaveAs)
        .Format = wdExportFormatPDF
        .Show
    End With
End Sub

As with all macros, you can add it to the Quick Access Toolbar or create a shortcut key to invoke it.

Both approaches discussed so far display a dialog box into which you must type a file name and pick a location for the PDF file. If you want to bypass the dialog box completely, a different macro approach may work for you.

Sub SaveAsPDF2()
    Dim sName As String
    Dim sPath As String

    With ActiveDocument
        sName = Left(.Name, InStr(.Name, ".") - 1)
        sName = sName & ".pdf"
        sPath = .Path & "\"

        .ExportAsFixedFormat _
          OutputFileName:=sPath & sName, _
          ExportFormat:=wdExportFormatPDF
    End With
End Sub

This macro figures out the folder for the currently open document and then saves the PDF into that folder using the same name as the document. So, for instance, if you are working on a document called "MyDoc.docx," then this macro will save the PDF as "MyDoc.pdf." No dialog box is displayed; the PDF file is simply created and saved.

If you prefer for your PDF files to be saved in a different folder, all you would need to do is assign the full path to that folder to the sPath variable. As an example, let's say that you want all your PDF files to be saved in a common folder. Just replace this line:

        sPath = .Path & "\"

with a line similar to this one, modified for your desired path:

        sPath = "c:\mypath\pdfs\"

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12240) applies to Microsoft Word 2007, 2010, 2013, and 2016.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Searching for Breaks

Word allows you to insert different types of breaks in your text that help control how your document is paginated. If you ...

Discover More

Calculating a Sum for a Range of Dates

If you use Excel to track information based on dates, you may wonder how to get a sum for only certain dates that you ...

Discover More

Generating Double-Digit Random Numbers

Normally you use the RAND and RANDBETWEEN functions to generate random numbers. What if you want to generate random ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Sending Printer Commands

If you need to send a command directly to your printer, then you need to use the PRINT field. It allows you to send ...

Discover More

Remembering Copies to Print

If you routinely need to print more than one copy of a document, you'll love the ideas presented in this tip. There's ...

Discover More

Getting Rid of Fragment Warnings

Word provides a wide variety of tools that ostensibly help make you a better writer. One of those tools is the grammar ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 1?

2017-08-07 08:02:38

Juanita H.

A huge thank you for this tip. You have no idea how much this is going to simplify my job.


2017-08-06 02:50:50

Ken Endacott

HSK

Your error message is occurring because the statement starts with a period and is not preceded by a With statement. If you are using the SaveAsPDF2 macro most likely you have inserted the sPath = .Parh & “\” statement outside the With grouping.

With … End With is used as follows:
The statements:

Selection.Font.Bold = True
Selection.Font.Italic = True
Selection.Font.ColorIndex = wdBlue

are equivalent to:
With Selection.Font
.Bold = True
.Italic = true
.ColorIndex = wdBlue
End With


2017-08-01 07:04:02

Richard

Small correction - In the Word 2007 interface, in Word Options, choose commands from Office Menu. In Word 2010 and later, choose commands from File tab.


2017-07-31 16:51:06

Jackie Oliveira

You can also save a document as a .pdf by going to your print menu and using the DocuCom PDF Driver. Simple and fast.

Jackie Oliveira


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.