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 machine.
How to do it...
Create a new codeunit from Object Designer.
Then add the following global variables:
Name
Type
SubType
Length
WordApp
Automation
'Microsoft Word 14.0 Object Library'.Application
WordDoc
Automation
'Microsoft Word 14.0 Object Library'.Document
WordAppSelection
Automation
'Microsoft Word 14.0 Object Library'.Selection
WordFont
Automation
'Microsoft Word 14.0 Object Library'.Font
CompanyInformation
Record
Company Information
ExportedPicture
Text
250
NewLine
Char
At this stage, save an uncompiled version of the codeunit and close it.
Export the codeunit to a text file.
Open...