Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created an HTML file using Emacs (org-mode export), which I want to open in Microsoft Word. However, Word says it cannot open the file. In the details of the error message, it says:

Reference to undefined entity 'hellip'.

For lack of a better fix, I go in to the file and replace all occurrences of "&hellip ;" with "...", but then I get a similar error message for 'nbsp', and so on.

What is the simplest way to get emacs to output an org-mode file in a form that can be opened in Microsoft Word, without losing formatting?

share|improve this question
    
Is there any particular reason you want to open the HTML file in Word (as opposed to exporting as OpenOffice with gives you an .odt that Word should be able to open?) Also which version of Org are you running? M-x org-version –  Jonathan Leech-Pepin Mar 14 '13 at 12:36
    
@Jonathan, The primary reason is that I do not have OpenOffice installed. Org is version 7.8.11. –  Brian Z Mar 15 '13 at 9:15
    
You do not need OO installed to export to odt and import odt to word (but see my answer below). –  David Jan 2 at 17:25
add comment

1 Answer

up vote 1 down vote accepted

There are many ways to do this, since org-mode supports so many different formats, and tools like pandoc converts among most of these formats.

I am not sure of the simplest way, and I had some odd results with the direct org -> docx conversion in pandoc, i.e. pandoc -s myfile.org -o myfile.docx, but there are still plenty of other options.

One approach starting with the .html export is to open the file in a browser and then copy-paste the contents to word. This preserves formatting. Another approach, described on the org-mode mailing list involves deleting the all xml lines at the top of the .html file at the top until the first line is the <html> tag.

As mentioned in a comment, you can also export to .odt (the open office writer format). This does not require an installation of OpenOffice. I just tried it with MS Word 2013. Although I got an error that said the file could not open because of an unspecified error in content.xml line 261, it was able to recover from the error and convert the .odt file to word, preserving formatting.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.