2

Good day. Could somebody tell me how can I get MSWord_File_Content from NotesDocument in XPages by Javascript and put it into RichText field? I'm trying without extracting MSWord file into temp_local_directory. Is it possible or i must extract it and work on local?

Andro Selva
  • 53,910
  • 52
  • 193
  • 240
  • Do you have a word document attached to a richtextfield and want to add it to xapages programatically? or are you using OLE objects? – Thomas Adrian Oct 30 '12 at 11:53
  • Can you provide more info where you are in solving this issue? – stwissel Nov 01 '12 at 17:13
  • For example. I need to compose a document. Calling a dialog show and I choose another document, which contains MSWord file in Rich_Text_Item. After "OK" button, MSWord content(text) placed into new document "Body". – Ramil Kaliyev Nov 02 '12 at 18:36

1 Answers1

1

Rama I presume you have a word attachment. You can use the EmbeddedObject.getInputStream to get hands on the file content. You then need to use Apache POI to access the document content. Then use the word2HtmlConverter to turn your doc into HTML and then you are good to go for the display in your RichText. Be smart and specify the RichText field as "save in MIME" which preserves all HTML properly. You might want to use a bean for that.

If your word document is an OLE object then you might be lucky with POI as well, but I never have tested that. Let us know how it goes.

Community
  • 1
  • 1
stwissel
  • 20,110
  • 6
  • 54
  • 101