New way of doing HTML/ASP > MS Word/Excel Doc

I have always dynamically created MS Word/Excel docs by creating a HTML/CSS-laden string, adding a few MS tags where needed (eg page setup stuff) and then giving it a .xls or .doc extension to force/create a file, but this seems to be dying out as the standard way of doing this.

I’ve tried to investigate what the latest way is that supersedes this tried and trusted method, but all I can find is a method where you try to zip-add an xml file into an docx/xlsx (zip archive) file, which looks mightily messy.

Could somebody please advise on what the latest method is to do this without using any form of bought-in component.

Thank you!

Hi admin401,

What application are you using to create MS docs this way?
(Please excuse me, I’m somebody that haven’t used Windows regularly since very long. :blush: )

I’ve tried to investigate what the latest way is that supersedes this tried and trusted method,

Could you please give a link to an example of this method, in case I’m not recognizing it properly?

Hi Erik

Thank you for coming back to me.

I use Classic ASP to build up/concat the required HTML, force the header to be excel or word and give the forced download an extension of .xls or .doc

Are your host pushing you to update to ASP.NET? MS sure are. Seems like you are left to continue with the method you already use. Can also non MS office suites render those docs correctly?

Found that you’ve cross-posted a copy of this topic at SO: https://stackoverflow.com/questions/55652536/new-way-of-doing-html-asp-ms-word-excel-doc

I’m aware that MS recommend SO for discussions, but Classic Asp topics might also be found at https://forums.asp.net/

Sorry I can’t help, maybe somebody knowledgeable in ASP could step in? :slight_smile:

You are unlikely to get much help in StackOverflow because the question is unclear.

It is not clear if you are doing that in the server. Please be specific; are you doing that in a web page anywhere?

That is really vague. What is the problem? What is the error message? What happens that is not supposed to happen or what does not happen that is supposed to happen?

I do not know what this is!

1 Like

Hi Samuel

I use Classic ASP (.asp) pages, which are executed on the server, to build up a string of HTML/CSS tags and then this is sent to a web page with an excel or word app type header so that the browser sends it to the user as an .xls or .doc file rather than just showing the HTML/CSS in the web browser.

Lots of people seemed to use this format, but even MS seem to want to bin it and force devs to create .xlsx or .docx files. My problem is what is the best method to create these types of files without buying in a COM/object that might have a limitation (ie no formatting capabilities or render speed issues) or might incur a high price. Hopefully I just want to keep creating the files myself.

I doubt that that is possible the way you describe. I know that the original Word file type has binary data. I also know that the original Word file type was never fully documented by Microsoft because it is not logical. I assume it is possible to generate an original-format Word file that does not use undocumented features but it seems highly unlikely that you can generate a Word file instead of a HTML file from ASP output.

See the following. The xlsx and docx formats are XML documents in a standard format.

There has got to be more to the story of what is being done in the existing website. You might not realize what it is that is doing something more and therefore I assume you need to research it more.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.