Create a Word Doc from Web App

I need create a Microsoft Word doc from a list in a Web App. The list is a 3 column table. I can format the output as an HTML table in Xojo and it looks nice on the screen. One column requires right justification which does work from HTML to Word. If I save the HTML file as a DOCX Word 2013 can open it and does an OK job of rendering it correctly except for the page margins that default to the Word normal default. Word 2013 apparently looks in the file with a DOCX extension to determine how to render it.

BUT … some users have Word 2010 which thinks the DOCX file is damaged and cannot be recovered. If I save it as HTML you can launch Word and browse to open the file. Of course if you double click it the file opens in your default browser. It appears Word 2010 does NOT observe font types and it ends up in the font Word uses as the default. Left right justification works but it always centers the columns vertically in the table cell even if the HTML specifies top. This will require more reformatting and not make the result very practical.

I am exploring Libre Office Portable that I saw in a post that says it can open HTML and save it as a Word doc then it can be edited in various versions of Word. No results yet on that workaround.

I have LibXL and MBS Plugins so I could save directly to Excel format but that does not seem to be a good alternative … yet.

So has anybody had any luck outputting Word formatted documents with a Web App. I know I could probably use OLE and write a desktop app to directly manipulate Word but that would not be very ideal even though it is all on the same LAN to a separate desktop app to connect to the DB would work.

Depends on what you want to output.

I do have a WordFileMBS class which some users use to customize existing Word files.

1 Like

I am generating a fairly standard table. Three columns. The left column is narrow and right justified. The right column is narrow and left justified. The center column is set to take the balance of the space on the page. It contains some underlining and superscript characters.

This is essentially an index of published papers and the center column follows a standard of listing authors with superscript numbers that match a list of institutions that follow the authors where the numbers next to the authors match the numbers on their institution.

Each output is from scratch and I do not have any way of knowing how many lines would be required so modifying a “template” file would probably not work unless you could add rows to an existing table in the template.

My Libre Office Portable install appears to be a MASSIVE install. Thousands of DLL’s and other files and I am only half done based on the progress bar.