Silent update 2019-09-25: added to blog series "Using Org Mode Features"
Please do read my "Using Org Mode Features" (UOMF) series page for explanations on articles of this series.
The amazing @pdfkungfoo tweeted about a nice feature of Pandoc, the universal document conversion tool:
According to the manual, the option "--reference-doc=FILE" may define a docx (Word) or odt (LibreOffice) document which is used as a format template file.
So if you do have a company template for arbitrary Word files, you could use it as a template for your export. Copy a docx file (not a dotx template) as reference.docx to either:
- the current folder OR
- a folder which is defined by
--data-dirOR - the system default folder for
data-dirwhich is$HOME/.pandocon UNIX-like systemsC:\Documents And Settings\USERNAME\Application Data\pandocon Windows XP you should not use any moreC:\Users\USERNAME\AppData\Roaming\pandocon Windows Vista or later.
So I took a company docx, renamed it to reference.docx and copied it to C:\Users\USERNAME\AppData\Roaming\pandoc on my Windows 10. When I now export from my Emacs Org-mode to a docx file (via ox-pandoc), I get documents that follow the style of our company documents: fonts, font colors, and even the company logo.
Awesome and nifty feature.
The only thing left is that I do have to learn how to avoid Emacs opening the resulting docx file as ZIP file in a buffer instead of opening it in Word.