This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.
This documentation relates to the latest version of Confluence.
If you are using an earlier version, please go to the documentation home page and select the relevant version.

Customise MS Word Exports

All Versions
Click for all versions
Confluence 2.9 Documentation

Index

Overview

Confluence exports a Confluence page as a Microsoft Word document by:

  1. Generating the HTML rendering of a page from Confluence wiki markup
  2. 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 our Confluence Developer Forum.

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:

...\confluence\WEB-INF\classes\styles\site-css.vm

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:

...\confluence\pages\exportword.vm

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:

  1. Identify its CSS tag in the main stylesheet. You may need to use trial and error to identify which cascading property is relevant
  2. Transfer the tag into the Word export wrapper so that it overrides the main stylesheet
  3. 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:

body, p, td, table, tr, .bodytext, .stepfield {
    font-family: Verdana, arial, sans-serif;
}

Modify Background Colour

The wrapper sets the background colour:

<body style="background-color: white; padding: 10px;">
    <h1>$page.title</h1>
    $renderedPageContent
</body>
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jul 11, 2007

    Pranav Olkar says:

    How do I customise headers and footers?Exporting pdf has a way to do this.But ex...

    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.

    1. Jul 12, 2007

      Mei Yan Chan says:

      Hi Pranav, I have created a feature improvement that is currently being tracked...

      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

  2. Nov 12, 2007

    Imtiaz B Syed says:

    How to export the page hierarchy (ie., including child pages from current page) ...

    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. 

    1. Nov 12, 2007

      Choy Li Tham says:

      Hi Imtiaz, Did you mean to say that you may want to export a page include all t...

      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

  3. Nov 29, 2007

    Tiffany Bartlett says:

    Is there any way to have more than one exportword.vm and then, when exporting to...

    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 

    1. Dec 05, 2007

      Ming Giet Chong says:

      Hi Tiffany, I would advice you to direct your questions to our forum and mailin...

      Hi Tiffany,

      I would advice you to direct your questions to our forum and mailing list as there might be other user/developers who have already implemented it and should be able to share their ideas with you.

      Regards,
      MG

  4. Apr 17, 2008

    neerdhapola says:

    I am trying to export the  page content from INFO->word as a WORD FILE ,...

    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 .

  5. Apr 17, 2008

    Anonymous says:

    You should read this issue and vote for it to be fixed: http://jira.atlassian.co...

    You should read this issue and vote for it to be fixed: http://jira.atlassian.com/browse/CONF-6246

  6. May 02, 2008

    Anonymous says:

    CSS "Cascading Style Sheets" LessoNs - WeB DesigN LessoN - - Web site : http://W...

    CSS "Cascading Style Sheets" LessoNs - WeB DesigN LessoN - - Web site : http://WWW.css-lessons.ucoz.com/index.html

  7. May 29, 2008

    Christoph Rauhut says:

    Hello, does any body knows whether it is possible to include MS Word "Fields" (...

    Hello,

    does any body knows whether it is possible to include MS Word "Fields" (like "

    Unknown macro: { TOC \* MERGEFORMAT }
    ") into the exportword.vm

    1. Jun 05

      Ming Giet Chong says:

      Hi Christoph, Did you mean that you would like to include the page content with...

      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