Page 1 of 1

convert docx to msg

PostPosted: Tue Apr 26, 2011 8:06 pm
by zhouyouq
Hi guys,

I need help for convert docx to msg(the format of OUTLOOK).and i want to see if DOCX4J is available to do it? How to do? or which API can deal with it?
Thank for your help.

Re: convert docx to msg

PostPosted: Tue Apr 26, 2011 8:09 pm
by jason

Re: convert docx to msg

PostPosted: Tue Apr 26, 2011 9:06 pm
by zhouyouq
jason wrote:Please see viewtopic.php?f=6&t=496


Hi jason,
I saw this link. But i want also to know how save it as the format .MSG? it seem Docx4J just can be saved to .DOCX .
For example, i parsed a DOCX, and got a lot of infos as XML.from here,How i can deal with it to .MSG?

Thanks in Advance,

Re: convert docx to msg

PostPosted: Wed Apr 27, 2011 12:29 am
by jason
I haven't done any work on this myself. A quick Google shows 3 open source Java libraries which may help:

http://svn.apache.org/viewvc/poi/trunk/ ... /poi/hsmf/

MAPIMessage.java says

/**
* Reads an Outlook MSG File in and provides hooks into its data structure.
*
* If you want to develop with HSMF, you might find it worth getting
* some of the microsoft public documentation, such as:
*
* [MS-OXCMSG]: Message and Attachment Object Protocol Specification
*/


http://code.google.com/p/java-libpst/

http://auxilii.com/msgparser/

I believe the native body stream of an outlook email message can be in RTF, plain text, or HTML. You might want to check whether it can now be docx as well. If not ... If the HTML can include the CSS emitted by docx4j, then using docx4j to make an HTML might be your easiest approach.

Please let us know what you discover. Good luck!