Microsoft Outlook - VBA - Save emails as PDF
Learn how to implement a VBA macro in Microsoft Outlook to easily save selected emails as PDF files to your hard drive, complete with step-by-step installation and usage instructions.
This article is over a year old but was reviewed on July 30, 2026 — the content is still accurate.
This article is part of the VBA & MS Office automation series:
- MS Office - How to create a ribbon in Excel
- MS Excel - How to call a SOAP web service
- How to optimize an existing MS Access database
- VBS - Retrieve the list of fields in a MS Access Database
- VBS - Auto update script
- Microsoft Outlook - VBA - Save emails as PDF
- VBS - Get list of files and generate a CSV
- MS Office - Load dropdown from Excel's range
- Export MS Access objects
- MS Excel - Get the list of references used in your modules

This article shares a VBA macro for the Outlook desktop client that saves one or more selected emails as PDF files, added to the Ribbon as a custom button via the VBA editor. When run, it prompts for a save folder, whether to delete the emails from Outlook after export, and whether to name each PDF manually or from the email subject.
You may also need to select several emails from Microsoft Outlook and save them as PDF files on your hard drive.
In my case, it was when I was complementary self-employed. I had to keep track of the orders I received and the invoices I sent. Saving my orders as PDFs meant that I could keep them as archives, even if my mail server failed.
This post will explain to you how to create such a macro for Outlook.
Result
Select one or more emails, click the button, and the macro walks you through three prompts:
- A confirmation to proceed with the selected emails.
- A folder picker — where the PDFs should be saved.
- Whether to remove the emails from Outlook afterward, and whether to name each PDF manually or reuse the email's subject line.
At the end, every selected email is saved on your hard disk as a PDF.
Prerequisites
You should have Microsoft Office on your hard disk and you need to have Outlook and Word installed.
The macro will not work with Office online.
Installation steps
Installation steps
- Just start your Microsoft Outlook client (as software on your hard disk; not in your web browser),
- Press ALT+F11 to open the
Visual Basic Editor(akaVBE) window, - Click on the
Insertmenu thenModule, - Click on the link https://github.com/cavo789/vba_outlook_save_pdf/blob/master/module.bas to open my repository on GitHub and click on the
Copy raw filebutton to copy the source code in the clipboard - Back to Outlook and press CTRL+V in the editor so you paste there the code,
- Close the
Visual Basic Editorand come back to Outlook, - Click anywhere on the Ribbon and select
Customize the Ribbon... - In the new dialog, click on the
New Groupbutton - In the Choose commands from, select
Macros, you should see theSaveAsPDFFilemacro as illustrated below. - Drag and drop the macro to your new group.
- Click on the
OKbutton to close the dialog.
You should see your new group, in my case, I've created the new group in Home and at the first position left so I've this:
The folder and naming dialogs
The confirmation, folder picker and naming prompts are described at the top of this article. The folder picker looks like this:
This article is part of the VBA & MS Office automation series:
- MS Office - How to create a ribbon in Excel
- MS Excel - How to call a SOAP web service
- How to optimize an existing MS Access database
- VBS - Retrieve the list of fields in a MS Access Database
- VBS - Auto update script
- Microsoft Outlook - VBA - Save emails as PDF
- VBS - Get list of files and generate a CSV
- MS Office - Load dropdown from Excel's range
- Export MS Access objects
- MS Excel - Get the list of references used in your modules





