struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hue Holleran" <>
Subject [OT] RE: microsoft .doc struts
Date Tue, 18 Feb 2003 15:36:44 GMT
Hi Andy,

I've looked through the thread and can't see specifically what you're trying
to do but we had exactly the same problem and was solved using RTF, thus:

(this was for submission of documents to a UK government body that needed to
be in MS Word .DOC format - they were able to open these documents with no
problem in Word: edit, print, save etc.).

We used RTF for the document - generated manually in MS Word and exported to
a .RTF - and used placeholders to hold active data that was to be inserted
into the template of format "[oTbl.Field]" (allowable in RTF - and replaced
these using (MS) reg ex of format "\[\S[^\[]*\]").

This then gave us an RTF format document which was then saved with the
extension .DOC - which MS Word opens with no problem at all. This was in
fact sent to the browser by adding a header "content-disposition" of type
"attachment; filename=""WORD.DOC""" and also specifying the "ContentType" of
"application/rtf". Saving this document saves the document in "Word" .DOC
although it is really an RTF.

Not sure it's what you're after but after battling trying to open MS Word on
the server - which needs administrator privileges for the user running the
web app (scary) or using vbscript/javascript in the browser (requires the
site to be added to IE "Trusted Sites") - not ideal.

The solution outlined, using RTF is not dependent on the browser used and
the above solution is being used to generate around 200-300 (probably more)
"MS Word" .DOC files a week which are emailed directly to the UK government

Let me know if this is an option for you - and if you need any more info but
BTW the above was implemented in MS ASP so I can only send you some
ASP/VBScript code if that will help.


-----Original Message-----
From: Andy Richards []
Sent: 18 February 2003 14:12
Subject: microsoft .doc struts


I have read with interest from the struts archives where a user posted
the following question to do with producing microsoft .doc files for
clients. See:

Peter S. Hamlen: posted a follow up talking about using office 2000
html, see:

What i cant understand and i am hoping that someone will be able to help
me, is that once you have parsed the .html template ie with velocity,
then how do you convert the html back to a .doc file. I could provide
for download the html pages, but the images i want to include would be
seperate from the html file. I am trying to think of a tidier way?
looking down the thread .rtf format is not the easiest, and POI is in a
early release. Anyone know what i can do? or have any suggestions?

dont worry i made my point about cross platform and proprietory .doc,
doc is what the client wants, and therefor .doc is what i am having to
try and give.



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message