When searching for how to properly format the page in MS Project when using ExportAsFixedFormat to generate a correctly formatted PDF?, users often discover that standard VBA methods do not work as advertised. The core issue lies within a specific software behavior: during the execution of the ExportAsFixedFormat method, the Task Name column automatically becomes at least 30% wider than its configuration in the current view
What to Know Before You Format Microsoft Project Pages for PDF Export
This forced expansion pushes subsequent columns off the page, making commands like PagesWide:=1 ineffective. Because official patches for errant VBA instructions in Microsoft 365 and Office | Project | For business | Other are rare, users must rely on manual column width adjustments and specific page scaling parameters (like PercentScale:=85) before running the export macro
How to Format Microsoft Project Pages for PDF Export Step by Step
Follow these Project actions for Format Microsoft Project Pages for PDF Export in order. The key interface checkpoint is Gantt Chart View Table.

- Open your MS Project file and apply your target view (e.g., Contract View )
- Locate the Task Name column header in the Gantt Chart table
- Manually click and drag the column boundary to reduce the width by about 25% . Note: The longest text may not be completely visible on your screen, but it will render correctly in the PDF
- Press Alt + F11 to open the VBA Editor, insert a new Module, and configure your FilePageSetupPage method to use PercentScale:=85 and PaperSize:=pjPaperA3 instead of PagesWide:=1
- Paste the fixed VBA macro (provided in Part 3) and run the PrintContractViewToPDF command
- Open the generated PDF file to verify the expected result: all text should be completely visible with reasonable space to the next column, fitting within a single page width
Sub PrintContractViewToPDF()
Dim pdfPath As String
Dim suggestedFileName As String
' Suggested file name with the current date
' Vorgeschlagener Dateiname mit aktuellem Datum
suggestedFileName = "Codeword\_ContractSection\_" & Format(Date, "yyyy-mm-dd") & ".pdf"
' Open dialog box for user to choose file location and name
' Öffnet das Dialogfeld, damit der Benutzer den Speicherort und den Dateinamen auswählen kann
pdfPath = GetSaveAsFile("Save as PDF", suggestedFileName)
' Check if a path was selected
' Überprüft, ob ein Pfad ausgewählt wurde
If pdfPath <> "" Then
' Select the "\_Contract View" view
' Wählt die Ansicht "\_Contract View" aus
On Error Resume Next
Application.ActiveProject.Views("\_Contract View").Apply
On Error GoTo 0
' Set up the page for one-page width and as many pages as necessary for height
' Konfiguriert die Seite für eine Seitenbreite und so viele Seiten wie nötig für die Höhe
Application.FilePageSetupPage \_
Name:="\_Contract View", \_
Portrait:=True, \_
PercentScale:=85, \_
PaperSize:=pjPaperA3
' Set up the margins for printing
' Konfiguriert die Ränder für den Druck
Application.FilePageSetupMargins \_
Name:="\_Contract View", \_
Top:=0.98, \_
Bottom:=0.98, \_
Left:=0.79, \_
Right:=0.5, \_
Borders:=pjAroundEveryPage
' Display the Print Preview to check the print layout
' Zeigt die Druckvorschau an, um das Drucklayout zu überprüfen
Application.FilePrintPreview
' Export the active view as a PDF using ExportAsFixedFormat method
' Exportiert die aktive Ansicht als PDF mit der Methode ExportAsFixedFormat
On Error Resume Next
Application.ActiveProject.ExportAsFixedFormat \_
FileName:=pdfPath, \_
FileType:=pjPDF, \_
IncludeDocumentProperties:=True, \_
IncludeDocumentMarkup:=True, \_
FromDate:=Application.ActiveProject.ProjectStart, \_
ToDate:=Application.ActiveProject.ProjectFinish
On Error GoTo 0
' Success message after export
' Erfolgsmeldung nach dem Export
MsgBox "PDF successfully exported to: " & pdfPath, vbInformation
' PDF erfolgreich exportiert nach: & pdfPath
Else
MsgBox "Operation cancelled.", vbExclamation
' Vorgang abgebrochen
End If
End SubHow to Verify the Project Result
Use this outcome as the acceptance test: Open the generated PDF file to verify the expected result: all text should be completely visible with reasonable space to the next column, fitting within a single page width Keep the original state unchanged if the result cannot be confirmed.
WPS Office: A Free Microsoft Office Alternative for Format Microsoft Project Pages for PDF Export
For local work related to Format Microsoft Project Pages for PDF Export, WPS Office is a free Microsoft Office-compatible alternative. It does not reproduce every proprietary Project service or administrator control, so use the Microsoft steps above when the task depends on that specific platform.
While you complete “Format Microsoft Project Pages for PDF Export” in Microsoft’s interface, use WPS Office for DOCX, XLSX, PPTX, CSV, and PDF files; WPS AI can also draft, rewrite, summarize, translate, and organize local content. Because the desktop interface follows familiar document, spreadsheet, presentation, and PDF conventions, most users can move common local work without rebuilding their workflow.

Project FAQs About Format Microsoft Project Pages for PDF Export
Why does PagesWide:=1 fail during the PDF export macro?
During the ExportAsFixedFormat execution, a known rendering glitch causes the task name column to dynamically widen by roughly 30%. This extra width overrides the PagesWide parameter, pushing subsequent data columns onto a second page.
Do I need the PtrSafe declaration in my VBA code?
Yes. Modern Microsoft 365 and Office | Project | For business | Other environments run on 64-bit architectures. Using PtrSafe and LongPtr ensures the Windows API call for the "Save As" dialog functions correctly without throwing compilation errors.
Why use PercentScale:=85 and A3 paper size?
Because the software artificially expands the columns during export, setting a larger virtual paper size (A3) and scaling down the content (85%) creates enough margin buffer to absorb the expansion, keeping everything on a single horizontal page.
Does reducing the column width affect my saved Project file?
Yes, adjusting the column width manually alters the current view. If you frequently view this table on your screen, you may want to add VBA instructions to your macro that restore the column width to its original size immediately after the PDF is exported.




