Hi hue, sounds great, i understand that you replace dynamic data into the template where where ever you have a [oTb*.field]. but what is (MS) reg ex,,,? some kind of regular expression api? if so i will have to do some more research as i am yet to understand regular expressions, and how to use them. (there is a jakarta api i think though). Also does this method work with images?, if so i think this is the route i will have to take.
Regards Andy On Tue, 2003-02-18 at 15:36, Hue Holleran wrote: > 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 > body. > > 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. > > H. > > -----Original Message----- > From: Andy Richards [mailto:[EMAIL PROTECTED]] > Sent: 18 February 2003 14:12 > To: [EMAIL PROTECTED] > Subject: microsoft .doc struts > > > Hi, > > 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: > http://www.mail-archive.com/struts-user@jakarta.apache.org/msg58536.html > > Peter S. Hamlen: posted a follow up talking about using office 2000 > html, see: > http://www.mail-archive.com/struts-user@jakarta.apache.org/msg58536.html > > 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. > > Regards > > Andy > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]