//define COM interface
COM wordApplication ;
COM wordDocuments ;
COM wordDocument ;
COM wordRange ;
;
//instantiation
wordApplication = new COM("word.application");
wordApplication.visible(true);
wordDocuments = wordApplication.Documents();
wordDocument = wordDocuments.add();
//Get a word document
wordDocument.saveas("C:\Axapta.doc");
//Write the data to word
wordDocument.activate();
wordRange = wordDocument.range(0,0);
wordRange.insertafter("Hello Axapta Word");
//Save and close document
wordDocument.save();
wordDocument.close();
wordApplication.quit();