Overview
Confluence exports a Confluence page as a Microsoft Word document by:
- Generating the HTML rendering of a page from Confluence wiki markup
- Overriding some Confluence page styles with MS Word styles using a CSS wrapper
The wrapper is generated using a Velocity macro to provide CSS style information specific to MS Word exports.
Modifying Content
Please do not attempt to modify the output without some experience in CSS and HTML markup. You may also need to review Velocity template language.
Before modifying any styles, you should always take a backup of both any files you are modifying and your entire Confluence install directory. If you require assistance with your customisation attempt, you should post your modified files along with a technical description to Atlassian Answers.
Important Files
The formatting is defined using the CSS styles in main Confluence stylesheet and overridden by any styles in the Word export wrapper.
Main Stylesheet
This file formats the default appearance of all Confluence content. Changes to this document will be shown when viewing a page from within Confluence, as well as in HTML or MS Word exports. You should avoid changing this document unless you wish a style to be changed throughout Confluence. The file is located under the Confluence install directory:
Export Wrapper
This file overrides the main Confluence stylesheet, so styles outlined in this file will be specific to MS Word exports. It set the font and style for body text, some macro and grids, and a default background colour. The file is located under the Confluence install directory:
How To Modify Styles
If the CSS tag already exists in the Word export wrapper, you can modify it directly. If the CSS tag is defined by the main stylesheet, copy it into the export wrapper as a new entry in the <style> element and update it there:
- Identify its CSS tag in the main stylesheet. You may need to use trial and error to identify which cascading property is relevant
- Transfer the tag into the Word export wrapper so that it overrides the main stylesheet
- Modify the tag style in the wrapper
Common Modifications
You can easily set the body font or background colour in the export wrapper.
Modify Body Font
The wrapper sets the body font:
Modify Background Colour
The wrapper sets the background colour:







11 Comments
Hide/Show CommentsJul 11, 2007
Pranav Olkar
How do I customise headers and footers?Exporting pdf has a way to do this.But exporting word does not seem to have any documentation regarding this.
Jul 12, 2007
Mei Yan Chan
Hi Pranav,
I have created a feature improvement that is currently being tracked at CONF-8889. Feel free to cast your vote to increase its popularity and add yourself as a watcher for future updates. Thanks.
Regards,
Mei
Nov 12, 2007
Imtiaz B Syed
How to export the page hierarchy (ie., including child pages from current page) in word format?
As of now the action which exist in Info Tab is only for one page. Similar action i need to generate page hierarchy in word format.
Nov 12, 2007
Choy Li Tham
Hi Imtiaz,
Did you mean to say that you may want to export a page include all the children pages in Word document. If this is the case, there is a feature request being tracked in the following:
If you are keen on this feature, please do cast your vote to increase its popularity and add yourself as a watcher to to get the future updates. Also, feel free to add comments to the feature to reflect the importance of this feature.
Regards,
Choy Li
Nov 29, 2007
Tiffany Bartlett
Is there any way to have more than one exportword.vm and then, when exporting to Word, be able to select the appropriate exportword.vm for the page?
Also, I'd like to add auto-numbering to exportword.vm, so that the headings have 1.0, 1.1, 1.1.1 ... I added some CSS to exportword.vm but it didn't work. Has anybody tried this?
Thanks,
Tiffany
Jun 03, 2011
Ming Giet Chong
Hi Tiffany,
I would advice you to direct your questions to Atlassian Answers as there might be other user/developers who have already implemented it and should be able to share their ideas with you.
Regards,
MG
Apr 17, 2008
neerdhapola
I am trying to export the page content from INFO->word as a WORD FILE , I have Problem Picture file are not coming in doc file . How can we get these picture file in word document .
Apr 17, 2008
Anonymous
You should read this issue and vote for it to be fixed: http://jira.atlassian.com/browse/CONF-6246
May 02, 2008
Anonymous
CSS "Cascading Style Sheets" LessoNs - WeB DesigN LessoN - - Web site : http://WWW.css-lessons.ucoz.com/index.html
Oct 18, 2011
Christoph Rauhut
Hello,
does any body knows whether it is possible to include MS Word "Fields" (like "{ TOC
* MERGEFORMAT }") into the exportword.vm
Jun 05, 2008
Ming Giet Chong
Hi Christoph,
Did you mean that you would like to include the page content with TOC plugin into the exported MS Word? If that is the case, you should be able to do so. If I have misinterpreted your requirement, please explain it for a better understanding. Alternatively, you can always raise a support ticket at our issue tracker at https://support.atlassian.com.
Regards,
MG
Add Comment