Batch Change the Paper Tray in Existing Word Documents
Question details
Change the first-page and subsequent-page paper sources in many existing DOCX files without editing each file manually.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A user needs to update paper tray settings across tens of thousands of existing Word documents.
- Observed behavior
- Changing the Normal template's default paper source affects new documents but does not update existing files.
Check the target printer and its available trays in Word's Page Setup dialog. Test any macro on a small folder of document copies first, and use macros only from a trusted source.
Batch update DOCX files in a Windows folder with a Word macro
Use this macro to update all DOCX files in one selected folder without opening and editing each one manually.
The macro sets every section's first-page and other-page trays to the printer's default bin, then saves each writable document. It does not process subfolders.
Documents that cannot be opened or saved are reported in the VBA Immediate window. Review that output and any read-only files before deploying the macro broadly.
In desktop Word for Windows, press Alt+F11. In the VBA editor, select Normal under Projects, then choose Insert > Module.
Paste this code into the module: Sub BatchSetPaperTray() Dim picker As FileDialog Dim folderPath As String, fileName As String Dim oldSecurity As Long, updated As Long, failed As Long Dim doc As Document, sec As Section Set picker = Application.FileDialog(msoFileDialogFolderPicker) If picker.Show <> -1 Then Exit Sub folderPath = picker.SelectedItems(1) & "\" oldSecurity = Application.AutomationSecurity On Error GoTo Finish Application.AutomationSecurity = msoAutomationSecurityForceDisable fileName = Dir(folderPath & "*.docx") Do While fileName <> "" If Left$(fileName, 2) <> "~$" Then On Error GoTo FileError Set doc = Documents.Open(FileName:=folderPath & fileName, AddToRecentFiles:=False) If doc.ReadOnly Then Err.Raise vbObjectError + 1, , "Document is read-only" For Each sec In doc.Sections sec.PageSetup.FirstPageTray = wdPrinterDefaultBin sec.PageSetup.OtherPagesTray = wdPrinterDefaultBin Next sec doc.Save doc.Close SaveChanges:=wdDoNotSaveChanges Set doc = Nothing updated = updated + 1 End If NextFile: On Error GoTo Finish fileName = Dir() Loop Finish: Application.AutomationSecurity = oldSecurity If Err.Number <> 0 Then MsgBox "Batch stopped: " & Err.Description MsgBox "Updated: " & updated & "; failed or skipped: " & failed & ". Check the VBA Immediate window for details." Exit Sub FileError: Debug.Print fileName & ": " & Err.Description failed = failed + 1 Err.Clear On Error Resume Next If Not doc Is Nothing Then doc.Close SaveChanges:=wdDoNotSaveChanges Set doc = Nothing Resume NextFile End Sub
Press F5 while the cursor is inside BatchSetPaperTray, select the test folder, and confirm the results. In the VBA editor, press Ctrl+G to review any failed or skipped files in the Immediate window.
Open several updated files in Word and check Layout > Page Setup > Paper, including documents with multiple sections. Print test pages on the intended printer before processing production files.

Apply paper tray settings when existing documents open
Use an AutoOpen macro when documents can be updated gradually as users open and save them.
Set the default paper source for new Word documents
Use this setting for future documents; it does not change existing files.
Edit Word Documents with WPS Writer
WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Word files. Its format compatibility makes it easy to move documents between office suites, although it does not fix Word's Normal.dotm macro behavior.

Frequently Asked Questions
Why didn't changing Normal.dotm update my existing documents?
Setting a default in Layout > Page Setup > Paper changes the template's defaults for new documents. Existing files retain their own page setup until they are changed and saved.
Does the batch macro process subfolders?
No. It processes DOCX files directly inside the folder selected in the folder picker. Run it separately for each folder or use a different automation method that explicitly handles subfolders.
Will the macro change every section in a document?
Yes. The macros loop through each document's Sections collection and set both FirstPageTray and OtherPagesTray for every section.
Why was a document skipped or not saved?
A file may be read-only, locked, protected, or otherwise unavailable. Press Ctrl+G in the VBA editor after the batch finishes to see the reported file names and errors.
Can I select a specific physical printer tray?
You can choose an available tray in Layout > Page Setup > Paper. Tray availability and behavior depend on the selected printer and its driver, so test the setting on the target printer.




