Winword Automation

I have to append a letter to the navision’s statement of account in which the debitor is asked if all values mentioned are correct. So I want to print the report in the normal way and afterwards in the Debitor’s OnPostDataitem I want to open Winword send the Values e. g. Debitors address, saldo to the document and print this. Can anyone out there assist me in doing this task as I don’t have any information on the Winword-Automation commands. Thanks! Peter

Hi If your question is only regarding word automation, there is a good step by step example in Navision Applications designers guid /(in chapter Extending C/AL). Please refer it. This examples refers the Customer table. Regards Joseph Mathew Edited by - joseph_mathew on 2001 May 21 14:30:23

Hmm, the explanation of how and why to use the C/AL-Code is nice, but I don’t know the handling of the fields in Winword. “using Insert, Field … in Microsoft Word” is not enough for me … Sorry. Peter

try this in OnPush button in a Customer Form for example: variables: --------------------------------------------- Name DataType Subtype Length wdapp Automation ‘Microsoft Word 9.0 Object Library’.Application wddoc Automation ‘Microsoft Word 9.0 Object Library’.Document wdrng Automation ‘Microsoft Word 9.0 Object Library’.Range ch Char code: --------------------------------------------- CLEAR(wdrng); CLEAR(wddoc); CLEAR(wdapp); CREATE(wdapp); wddoc := wdapp.Documents.Add; wdapp.ActiveDocument.Fields.Update; ch := 13; wdrng := wdapp.ActiveDocument.Range; wdrng.InsertAfter(“No.”); wdrng.InsertAfter(format(ch)); wdrng.InsertAfter(“Name”); wdapp.Visible := TRUE; CLEAR(wdrng); CLEAR(wddoc); CLEAR(wdapp);