Thursday, December 7, 2006

Creating a MS Word Document from X++

Heres the Code :)

COM wordApplication;
COM wordDocuments;
COM wordDocument;
COM wordRange;
;
wordApplication = new COM("word.application");
wordApplication.visible(TRUE);
wordDocuments = wordApplication.Documents();
wordDocument = wordDocuments.add();
wordDocument.saveas("c:\\YourDocument.doc");
wordDocument.activate();
wordRange = wordDocument.range(0,0);
wordRange.insertafter("Arijit Basu");
wordRange = wordDocument.range(6,19);

wordRange = wordDocument.range(11,26);
wordRange.italic(true);
wordDocument.save();
wordDocument.close();
wordApplication.quit();

3 comments:

  1. Hi

    i'm working with the DocuActionCOM_Word class to add a word document to an item. Is it possible to add a some commen properties to that Word-document? You can add these properties manualy file-properties-custom. I need this becouse when i save the document on my sharepoint, i want my custom fields to be filled in.

    can you help me?

    sander broché

    ReplyDelete
  2. Hi

    i'm working with the DocuActionCOM_Word class to add a word document to an item. Is it possible to add a some commen properties to that Word-document? You can add these properties manualy file-properties-custom. I need this becouse when i save the document on my sharepoint, i want my custom fields to be filled in.

    can you help me?

    sander broché

    ReplyDelete
  3. I agree,this situation is difficult and I offer use next software-how to fix docx files,because program helped me many times and has free status,it export recovered data into a new Word document,program scans damaged document, fix docx open and analyzes the data,will recover it and show in a preview window, where the user can check it and make sure, that it is recovered properly,can fix damaged docx and recover documents of different formats (*.doc, *.docx, *.dot, and *.dotx) as well as *.rtf (rich text files),can extract the data and fix docx file from any removable media even via local network of your organization.

    ReplyDelete