Dynamics 365 Business Central: Save a document as a Word attachment (Attach as Word) – Customization
This customization demonstrates two approaches to save Business Central documents as Word attachments instead of PDF files. It shows how to modify the Attach as PDF action's behavior using event subscribers or create a new Attach as Word action with custom logic.

post Dynamics 365 Lab
Key points
- The standard Attach as PDF action saves documents as PDF files to the document attachments FactBox
- Customization requires changing the report output format to Word and renaming the file extension to .docx
- Event subscribers can hook into OnBeforeSaveReportAsPDF (Report Selections table) and OnBeforeSaveAttachment (Document Attachment table) to modify the standard behavior
- A page extension approach creates a new action without modifying standard logic, using Report.SaveAs with ReportFormat::Word parameter
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- codeunit “SaveAsWordHandler”
- page “PostedSalesInvoicesExt”
Not found in BC28-30: codeunit “SaveAsWordHandler”, page “PostedSalesInvoicesExt”.
Context
- Features: Attach as Word action, Document attachments, Report format conversion, Posted Sales Invoices customization, Custom layout reporting
Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.