HTML to Word

  
Hi All,

I am currently working on creating a word document in Outsystems, and figured out word easily swallows html code. Even pagebreaks are possible by using <br clear="all" style="page-break-before:always" /> inside the html.

However, I need to present the html page with a .doc extension and then make it downloadable. The download component in outsystems only takes binaries as input, and of course, external css and javascript files will throw errors in word. So could anyone help me with the following questions:
- is it possibleto store a html page with a .docextansion as a binary to offer it as download.
- is it possible to change the base layout of a page to take the css and js references out and add inline css code in the header, and possibly change the mime type of the page
- and in case the binary does not work, would it be possible to present the page in the browser with a .doc instead of aspx extension after changing the mime type, as in that case most browsers will present the page as a download.

Any help will be highly appreciated.
it seems you are heading in the wrong direction.

as this isnt all to trivial, im going to give you a hint:
probably the easier way for you would be creating *.docx files;
try creating a new docx word document and write some lines into it,
then save it and rename .docx to .zip

when you open the zip, you will find .xml files, in which you should be able to set all you need.

plus its also easier creating .xml and .zip files from agile platform

good luck!
This is an option i investigated, but the word document i need is rather lenghty and contains images and a lot of variables. It would mean an awfull lot of xml that needs to be generated. I will have a second look at it, but think the html to word option would be a quicker solution.
A while ago I made this extension to wrap a library (http://notesforhtml2openxml.codeplex.com/releases/view/64828) that converts HTML to DOCX. It's an open source library, and it has many limitations that make it work only on very simple screens, but maybe it's worth checking out.
Hello Erik, 

If I understood correctly, you have a HTML page ready , and want to grab the HTML? If so, there is an extension called RichMail that has an action that does just that, it grabs the HTML as Text of a specific URL. This RichMail extension comes with the old Email Services App http://www.outsystems.com/NetworkSolutions/ProjectDetail.aspx?ProjectId=80, I guess that in the newer versions of the agile platform (6 and above) the RichMail extension might already be available. If not, just get it from the Email Services app.

As you said, you would have to do some cleaning up of the HTML you just grabbed, remove the css links, etc...

Now you need to convert that clean HTML text into binary with the BinaryData Extension, using the action TextToBinay.

Erik, be aware that I have never done such a thing, I'm just providing you some tools that may help you accomplish what you want.

Hope it helps!

Cheers!

Erik,

About 3 years ago I lost A LOT of time investigating for a way to do this, I did what Enigma sugested in his post and many other ways. But there are so many variable to the conversion that in the end I never found a truly realiable and stable way of doing it... so I ended up just converting the HTML to PDF.

If you find a good solution please let us know!

Cheers,
Hermínio Mira
I just did a short test with storing the html as plain text in a variable, then converting it to binary and downloading it as a .doc file. This seems to work fine, the only thing is that it shows as web layout and not as print layout in word. I have yet to test this with a more complex html structure, but so far it looks promising.
Ok, so the next question would be, How can i put the html output of a webblock into a variable so that i can use it in a binary conversion. Anyone any ideas?
Erik Stalenhoef wrote:
I just did a short test with storing the html as plain text in a variable, then converting it to binary and downloading it as a .doc file. This seems to work fine, the only thing is that it shows as web layout and not as print layout in word. I have yet to test this with a more complex html structure, but so far it looks promising.
 
what you have there is basically a html file, with a doc ending
as you can also use word to create simple html pages
but its not an actual doc file

didnt joaos extension work?