Creating a Word document from a template

Microsoft Office Word can present Dynamics AX data in a variety of formats. One way is to use Word templates which can combine predefined formats with Dynamics AX data to generate nice looking business documents. Another way of formatting extracted Dynamics AX data using Office documents is the newly introduced Microsoft Office Add-ins.

But if Add-ins are not installed, Dynamics AX still allows Word documents to be created from code. Although there are no standard helper classes for Word as we have for Excel, Word documents can still be created using a very similar approach by calling COM components directly.

In this recipe, we will create a simple Word document from a template. We will use the COM component ...

Get Microsoft Dynamics AX 2012 Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.