Printing Problems

How to Customize the Word VBA Printer Selection Dialog

John WilsonJohn Wilson Nov 3, 2026 869 views

Question details

The user wants to customize the built-in Word VBA printer setup dialog by adding custom buttons or controls, and needs a way to prevent the macro from printing if the user clicks Cancel.

How to Customize the Word VBA Printer Selection Dialog
Product
Word
Device & OS
not provided
Scenario
Writing a VBA macro to manage printer selection, configure printer settings, and execute print jobs safely.
Observed behavior
The built-in Application.Dialogs(wdDialogFilePrintSetup).Show dialog is fixed and does not allow the addition of custom Configure, OK, or Cancel buttons.
Before you start

Ensure you have basic familiarity with VBA (Visual Basic for Applications) and have enabled the Developer tab in your Word application.

Solution 1Recommended

Create a Custom UserForm to Replace the Built-In Dialog

Since the built-in printer dialog cannot be directly modified, you must design a custom UserForm that simulates the printer selection process and includes your desired buttons.

Creating a custom UserForm is the only way to fully control the user interface for printer selection. This allows you to add specific 'Configure', 'OK', and 'Cancel' buttons tailored to your macro's workflow.

1
Open the VBA Editor

Press Alt + F11 to open the Visual Basic for Applications editor, then go to Insert > UserForm to create a new blank form.

2
Design the Form Interface

Use the Toolbox to add a ComboBox for listing available printers, and insert CommandButtons for your 'OK' and 'Cancel' actions.

3
Populate the Printer List

Write VBA code in the UserForm_Initialize event to detect available system printers and populate the ComboBox.

4
Assign Button Macros

Double-click your custom buttons to write the execution code. Ensure your 'OK' button triggers the PrintOut command and your 'Cancel' button simply closes the form using Unload Me.

Create a Custom UserForm to Replace the Built-In Dialog
Printer Specifics: Controlling specific printer properties (like duplex or tray selection) requires sending explicit commands to the printer driver, as each printer model uses different settings.
Free Microsoft Office alternative

Looking for a Better Way to Manage Documents? Try WPS Office

If you are frustrated by the rigid limitations of Microsoft Word's built-in dialogs, consider switching to WPS Office. It is a highly compatible, free, and lightweight suite that handles standard Word formats perfectly while offering a familiar interface for all your document and printing needs.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package.
  2. 2. Install the Suite: Run the installer and follow the on-screen prompts to set up WPS Office on your computer.
  3. 3. Open Your Documents: Launch WPS Writer and open your existing Word documents to experience seamless formatting and printing.
Free and lightweight office suiteFully compatible with Microsoft Word documents (.docx)Familiar user interface for seamless migrationRobust built-in printing and document management tools
microsoft office alternative - wps office

Frequently Asked Questions

Can I add a custom button directly to Word's built-in printer dialog?

No, the built-in wdDialogFilePrintSetup dialog is fixed by the application and cannot be modified to include extra buttons like 'Configure' or custom 'Cancel' actions.

How do I stop my macro from printing if the user clicks Cancel?

You need to evaluate the return value of the dialog. If the dialog returns 0 (indicating Cancel), your macro should bypass the PrintOut command entirely using an If statement.

How can I control specific printer settings using VBA?

Because each printer model has unique properties, you cannot control them all via standard Word dialogs. You must either send specific commands to the printer driver or use a custom UserForm designed around that specific printer's capabilities.