Sending data to Microsoft Word
Creating attractive Word documents from NAV is a challenging task. This recipe will not show you how to create a document that looks exactly like your report from NAV, but it will introduce you to the basics of sending data to the application.
Getting ready
Microsoft Word must be installed on the client system.
How to do it...
Create a new codeunit from Object Designer.
Add the following global variables:
Name
Type
Subtype
Length
WordApp
Automation
'Microsoft Word 12.0 Object Library'.Application
WordDoc
Automation
'Microsoft Word 12.0 Object Library'.Document
WordAppSelection
Automation
'Microsoft Word 12.0 Object Library'.Selection
WordFont
Automation
'Microsoft Word 12.0 Object Library'.Font
CompanyInformation
Record
Company Information
ExportedPicture
Text
250
NewLine
Char
Save an uncompiled version of the codeunit and close it.
Export the codeunit to a text file.
Open the file and remove all of the events that were added by the...