How to batch-convert MS Word files from Letter page size to A4?

Here is some VBA you can add as a macro to change all the Word documents in a given folder.

WARNING: Make a backup copy of your files prior to running this code.

Open a new Word document, paste this code into the VBA window (Alt+F11). Make necessary changes to the path, then close the window.

Sub ChangePaperSize()
Dim myFile As String
Dim myPath As String
Dim myDoc As Document

'Change to the path where your documents are located.
'This code changes ALL documents in the folder.
'You may want to move only the documents you want changed to seperate folder.
myPath = "C:\temp\"

'Closes open documents before beginning
Documents.Close SaveChanges:=wdPromptToSaveChanges

'Set the path with file name for change
myFile = Dir$(myPath & "*.docx")

    Do While myFile <> ""

    'Open the document and make chages
    Set myDoc = Documents.Open(myPath & myFile)
    myDoc.PageSetup.PaperSize = wdPaperA4

    'Close and saving changes
    myDoc.Close SaveChanges:=wdSaveChanges

    'Next file
    myFile = Dir$()
    Loop
    msgbox "Process complete!"    
End Sub

Open the Macro window (Alt+F8) and choose ChangePaperSize, then click run. The current open document will close and other documents will open and close as it makes the changes to each document in the folder.


PowerShell version based on CharlieRB's answer:

param(
    [parameter(position=0)]
    [string] $Path
)

$docFiles = (Get-ChildItem $Path -Include *.docx,*.doc -Recurse)

$word = New-Object -com Word.Application

foreach ($docFile in $docFiles) {

    $doc = $word.Documents.Open($docFile.FullName)
    $doc.PageSetup.PaperSize = [Microsoft.Office.Interop.Word.WdPaperSize]::wdPaperA4

    $doc.Save()
    $doc.Close()

}

$word.Quit()