Use the below job if you want to read text from MS Word document in Dynamics Ax 2009.
str document = "D:\\Demo Edition.doc";
COM wordApplication;
COM wordDocuments;
COM wordDoc;
COM range;
// Get documents property
wordDocuments = wordApplication.Documents();
info(txt.getText());
}
static void FileIO_ReadFromWord(Args _args)
{ str document = "D:\\Demo Edition.doc";
COM wordApplication;
COM wordDocuments;
COM wordDoc;
COM range;
TextBuffer txt = new TextBuffer();
;// Create instance of Word application
wordApplication = new COM("Word.Application");// Get documents property
wordDocuments = wordApplication.Documents();
// Add document that you want to read
wordDoc = wordDocuments.add(document);range = wordDoc.range();
txt.setText(range.text());// to replace carriage return with newline char
txt.replace('\r', '\n'); info(txt.getText());
}