The Office Connector (also known as Word/DAV plugin) allows you to import from or edit pages in popular word processing applications such as MS Word and Open Office Writer. This tutorial shows how to add navigation links to these features.
Overview
The "Edit in Word" feature allows you to edit a wiki page using popular word processing applications. When you click the link, the page will open in the word processor (you'll sometimes be asked to log-in while doing this) and when you've made your changes simply save the document and the wiki page will be updated (you'll have to refresh the wiki pages to see the changes take effect).
The "Doc Import" feature allows you to import a word processor document in to a wiki page. This is useful when you have documents that contain formatting that's not possible using wiki markup - the document will be rendered in your wiki page as close as is possible to the original, but not nessecarily exactly the same.
| Important The code snippets below have been split on to multiple lines to make them easier to read. When you are adding them to your theme layout please remember to put everything on a single line. You must have the plugin installed before you can use these features. Also, please note that the links are different depending on your version of Confluence. |
Edit In Word macro
The Office Connector plugin has a handy macro that you can drop in to any theme panel to add an "Edit in Word" link:
{editinwordlink}
You can see some examples in the Office Connector Support FAQ.
Confluence 2.8 and above
The way that the edit in word link is generated by the office connector code is not compatible with the builder menu system, to work around this we have duplicated and refined the office-connector's code and included it within builder (not the connector itself, but the code that calls it), to use the edit in word feature in a builder menu you will need Builder 3.3.0 or later and use the following syntax
{compound-menuitem:editInWord|icon=word|caption=Edit this %page% in word...}
Tip: You can use any of the menu icons available in Theme Builder if preferred.
To add the "Doc Import" link to your menu, use the following notation:
{compound-menuitem:webui
|location=system.content.action/secondary
|key=importworditem1
|caption=Doc Import}
Confluence 2.7 and earlier
The way that the edit in word link is generated by the office connector code is not compatible with the builder menu system, to work around this we have duplicated and refined the office-connector's code and included it within builder (not the connector itself, but the code that calls it), to use the edit in word feature in a builder menu you will need Builder 3.3.0 or later and use the following syntax
{compound-menuitem:editInWord|icon=word|caption=Edit this %page% in word...}
Tip: You can use any of the menu icons available in Theme Builder if preferred.
To add the "Doc Import" link to your menu, use the following notation:
{compound-menuitem:webui
|location=system.page
|key=importworditem
|caption=Doc Import}
Adding the links to the Edit menu
Go in to the Layout Manager and click on the Menus Tab:

Click on the "Edit" button in the "Menu Shortcut Macros" section and then click on the "Edit Menu" tab of the window that appears:

Add the appropriate macros based on the version of Confluence you are using (see above) and then click the "OK" button to confirm the changes.
Save your layout (click the
button - see Layout Manager for more details) and you should see the new links appear in the Edit menu.
Adding text hyperlinks (outside of a menu)
To add text hyperlinks outside of a menu, eg. in a sidebar, just add the "flat=true" parameter to the compound-menuitem macro, for example:
{compound-menuitem:webui
|location=system.content.action/primary
|key=editinworditem3
|icon=page_white_word
|caption=Edit in Word
|flat=true}
.png)








Comments (22)
Aug 29, 2008
nana asah says:
The edit in word link to macro given for 2.8 and above does not work I copied...The edit in word link to macro given for 2.8 and above does not work
I copied it exactly as shown.
Sep 04, 2008
Jessica King says:
Same here. The "Edit in Word" macro launches the file, but the instructions for ...Same here. The "Edit in Word" macro launches the file, but the instructions for adding the "Edit in Word" link to a Confluence 2.8 menu does absolutely nothing.
Sep 04, 2008
Guy Fraser says:
Adaptavist are currently investigating this problem, with the assistance of Ryan...Adaptavist are currently investigating this problem, with the assistance of Ryan Ackley (the plugin author). It seems that there are issues with the links generated by the plugin in Confluence 2.8 which prevent the link from functioning properly in custom themes.
We'll update this page with more information as it becomes available.
Sep 10, 2008
Michael Spoonauer says:
The Office Connector for Confluence also cannot be integrated into the menus of ...The Office Connector for Confluence also cannot be integrated into the menus of Confluence 2.7 or earlier either.
I tested it within an instance running Confluence 2.5.7, Theme Builder 2.0.9, and Office Connector 1.3.6.
Attempting to use any of the following three menu items resulted in no menu item being displayed, and no errors being reported in the Atlassian Confluence log:
{menuitem}{menulink:webui|location=system.page.actions|key=editinworditem1}Edit in Word{menulink}{menuitem} {menuitem}{menulink:webui|location=system.page|key=editinworditem2}Edit in Word{menulink}{menuitem} {menuitem}{menulink:webui|location=system.content.action/primary|key=editinworditem3}Edit in Word{menulink}{menuitem}Is there any chance that you and Ryan can also determine why none of the above menu items will appear in Confluence 2.7 or earlier?
Sep 12, 2008
Ryan Ackley says:
Guy, can you file a bug in JIRA if you understand the issue. http://developer.a...Guy, can you file a bug in JIRA if you understand the issue.
http://developer.atlassian.com/jira/browse/WORDDV
I have no idea why this wouldn't be working. Is it something wrong with the javascript that themebuilder is having trouble with?
Sep 12, 2008
Guy Fraser says:
It's the same problem that's being discussed in the ticket we've added you to on...It's the same problem that's being discussed in the ticket we've added you to on our tracker (StatPro). I think Alain recently added some more info to that ticket for your review?
Also, are you at AtlasCamp? If so, maybe we can sit down together and find a solution?
Sep 13, 2008
Ryan Ackley says:
I don't see any information besides There are appear to be quite a few problem...I don't see any information besides
Am I overlooking something? Is anyone able to get the OC interface items to show up? Can you verify whether or not this is happening for all builder users?
Sep 13, 2008
Guy Fraser says:
It's happening for all Builder users and also several customers who are using ot...It's happening for all Builder users and also several customers who are using other themes (eg. custom java theme plugins).
One workaround temporarily is to add the {editinwordlink} macro to the title panel or call it from velocity in a custom java theme plugin.
Sep 13, 2008
Ryan Ackley says:
How do I get a copy of themebuilder 3? If this is a problem with theme builder y...How do I get a copy of themebuilder 3? If this is a problem with theme builder you owe me a beer...
Unfortunately, I probably won't be at AtlasCamp to collect. I just moved to Sydney. I can't see them sending me back so soon.
Sep 14, 2008
Michael Spoonauer says:
Here is what I have learned thus far in a Confluence 2.5.7, Builder 2.0.9, Conne...Here is what I have learned thus far in a Confluence 2.5.7, Builder 2.0.9, Connector 1.3.6 environment:
{menuitem}{menulink:webui|location=system.page.actions|key=editinworditem1}Edit in Word{menulink}{menuitem}<resource type="download" name="editinword.gif" location="templates/extra/editinword/editinword.gif"/>{menuitem}{menuicon:../../com.atlassian.confluence.extra.officeconnector:editinworditem1/editinword}{menulink:webui|location=system.page.actions|key=editinworditem1}Edit in Word{menulink}{menuitem}{menuitem}{menuicon:../../com.atlassian.confluence.extra.officeconnector:editinworditem1/editinword}{menulink:webui|location=system.page|key=importworditem}Import from Word{menulink}{menuitem}to:
http://www.mywikisite.com/display/MYSPACE/My+Wiki+Page#" onclick="if (window.ActiveXObject){var ed; try{ed = new ActiveXObject(<a href='#onclick="if (window.ActiveXObject){var ed; try{ed = new ActiveXObject('SharePoint.OpenDocuments'Sep 14, 2008
Michael Spoonauer says:
To figure out whether "return false;" statements were really needed when using t...To figure out whether "return false;" statements were really needed when using the "javascript:" syntax, I exploded the JavaScript out into a readable form and removed the return statements:
As you can see, because you do a sufficient amount of "if" tests and error checking, I don't think you would ever be sent down a path you should not go down based on your browser, etc.
So I packed up that version of the JavaScript, made that the logic to be executed after the "javascript:" call in all three web-items within atlassian-plugin.xml, re-JAR'ed the files, and re-installed the plugin JAR.
Now, when I click on "Edit in Word", in both Firefox and IE, the file is opened via WebDAV for editing, and I can apply changes, save them, and refresh the corresponding Wiki page to see them.
I ran into additional issues after reaching this point, but I don't think they're Theme Builder-related, so I have captured them as potential Office Connector issues:
Sep 18, 2008
Guy Fraser says:
Quick update: We've made some progress on the integration issues (still undergoi...Quick update: We've made some progress on the integration issues (still undergoing testing).
One interim workaround is to add the {editinwordlink} in to one of your theme panels, outside a menu.
We'll hopefully be posting details in the coming week as to how to get the links working from within a menu.
Sep 25, 2008
Michael Spoonauer says:
I'm sorry I can't test it myself right now, but I'm pretty sure that "Import Doc...I'm sorry I can't test it myself right now, but I'm pretty sure that "Import Doc" has the same limitations as "Edit in Word". You lose the same types of formatting, as it's saving it as an actual Wiki page.
If you want the majority of the formatting to be preserved, you need to use the {viewfile} macro.
A neat trick would be to define an "Import and Preserve" or similarly named menu link that creates a new Wiki page with the name of the Word document, uploads the Word document as an attachment to the page, and adds the line {\viewfile:Imported+Document+Name.doc} to the page before saving it and presenting it to the user.
Thanks,
Mike
Sep 25, 2008
Alain Moran says:
You would need to talk to the developer of the plugin (Ryan Ackley) about that.You would need to talk to the developer of the plugin (Ryan Ackley) about that.
Sep 25, 2008
Michael Spoonauer says:
Can you update, though, the Overview section of this page to be reflective of wh...Can you update, though, the Overview section of this page to be reflective of what the "Doc Import" feature is actually capable of doing?
I hope my comments on this page about implementing a work-around to the Builder / Office Connector mismatch were helpful in creating an "editInWord" menu item.
Thanks,
Mike
Sep 25, 2008
Alain Moran says:
Unfortunatley we do not have any control over the office connector code, you wil...Unfortunatley we do not have any control over the office connector code, you will need to speak to Ryan Ackley about any changes you would like made to that plugin.
Sep 26, 2008
Guy Fraser says:
Ryan should be connected via https://support.atlassian.comRyan should be connected via https://support.atlassian.com
Sep 26, 2008
Michael Spoonauer says:
I'm not asking for a Connector code change. I am asking for you to update your ...I'm not asking for a Connector code change. I am asking for you to update your documentation to be accurate.
You state:
But the Office Connector Documentation for "Doc Import" states:
http://confluence.atlassian.com/display/CONFEXT/Document+Import+with+the+Office+Connector
Sep 26, 2008
Alain Moran says:
updated.updated.
Oct 23, 2008
Philip Parkinson says:
You make reference to builder 3.2.2 in your documentation here, however the late...You make reference to builder 3.2.2 in your documentation here, however the latest release is 3.2.1. Are you refering to your early release version?
In any case having no luck with Builder 3.2.1 and the example menu macros.
Oct 23, 2008
Alain Moran says:
3.2.2 has been bumped now to become 3.3.0 and is available through the Early Acc...3.2.2 has been bumped now to become 3.3.0 and is available through the Early Access Programme
Nov 05, 2008
Tomi Strugar says:
When you have time it would be great to have a new icon for this, word_edit, lik...When you have time it would be great to have a new icon for this, word_edit, like the existing word icon just with a little pencil added next to it (like the other _edit icons).