Robert Dean
Robert Dean

Reputation: 3203

Best way to export html to Word without having MS Word installed?

Is there a way to export a simple HTML page to Word (.doc format, not .docx) without having Microsoft Word installed?

Upvotes: 16

Views: 42716

Answers (10)

Biri
Biri

Reputation: 7181

If you have only simple HTML pages as you said, it can be opened with Word.

Otherwise, there are some libraries which can do this, but I don't have experience with them.

My last idea is that if you are using ASP.NET, try to add application/msword to the header and you can save it as a Word document (it won't be a real Word doc, only an HTML renamed to doc to be able to open).

Upvotes: 12

Amay Kulkarni
Amay Kulkarni

Reputation: 838

use this link to export to word, but here image wont work:

http://www.jqueryscript.net/other/Export-Html-To-Word-Document-With-Images-Using-jQuery-Word-Export-Plugin.html

Upvotes: 0

JasonPlutext
JasonPlutext

Reputation: 15863

If you are working in Java, you can convert HTML to real docx content with code I released in docx4j 2.8.0. I say "real", because the alternative is to create an HTML altChunk, which relies on Word to do the actual conversion (when the document is first opened).

See the various samples prefixed ConvertInXHTML. The import process expects well formed XML, so you might have to tidy it first.

Upvotes: 2

James Stallings
James Stallings

Reputation: 96

There is an open source project called HTMLtoWord that that allows users to insert fragments of well-formed HTML (XHTML) into a Word document as formatted text.

HTMLtoWord documentation

Upvotes: 3

Andrew Hancox
Andrew Hancox

Reputation: 2340

There's a tool called JODConverter which hooks into open office to expose it's file format converters, there's versions available as a webapp (sits in tomcat) which you post to and a command line tool. I've been firing html at it and converting to .doc and pdf succesfully it's in a fairly big project, haven't gone live yet but I think I'm going to be using it. http://sourceforge.net/projects/jodconverter/

Upvotes: 4

Joel Coehoorn
Joel Coehoorn

Reputation: 415735

If it's just HTML, all you need to do is change the extension to .doc and word will open it as if it's a word document. However, if there are images to include or javascript to run it can get a little more complicated.

Upvotes: 1

JimmyJ
JimmyJ

Reputation: 4441

i believe open office can both open .html files and create .doc files

Upvotes: 0

Neall
Neall

Reputation: 27134

While it is possible to make a ".doc" Microsoft Word file, it would probably be easier and more portable to make a ".rtf" file.

Upvotes: 2

Ian Nelson
Ian Nelson

Reputation: 58753

I presume from the "C#" tag you wish to achieve this programmatically.

Try Aspose.Words for .NET.

Upvotes: 1

Peter Evjan
Peter Evjan

Reputation: 2433

Well, there are many third party tools for this. I don't know if it gets any simpler than that.

Examples:

Also found a vbscribt, but I'm guessing that requires that you have word installed.

Upvotes: 1

Related Questions