This page last changed on Dec 02, 2008 by smaddox.
The View File macro allows you to embed an Office document into your Confluence page. You will attach the Office document to a wiki page, then code the View File macro to display the document's content.
When viewing the page, users will see the content of the Office document. Users do not need to have Office installed, in order to see the content of the Office document.
Where applicable, users will be able to open the document for editing in their Office application.
This is just one of the ways Confluence can interact with Office documents. For an overview of all Office Connector features, please refer to Working with the Office Connector.
On this page:
Error formatting macro: toc: java.lang.NullPointerException
Basic Usage
{viewfile:my document.doc}
{viewfile:my presentation.ppt}
{viewfile:my spreadsheet.xls}
{viewfile:my document.pdf}
Example of Usage
The live example below shows how to display an Excel spreadsheet on a Confluence page. The Excel spreadsheet is attached to this documentation page.
What you need to type |
What you will get |
{viewfile:my spreadsheet.xls} |
my spreadsheet.xls
Task |
Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
Sunday |
Total |
|
11/3/08 |
11/4/08 |
11/5/08 |
11/6/08 |
11/7/08 |
11/8/08 |
11/9/08 |
|
Planning |
5 |
3 |
|
|
|
|
|
8 |
Design |
3 |
5 |
2 |
|
|
|
|
10 |
Development |
|
|
6 |
5 |
5 |
|
|
16 |
Testing |
|
|
|
2 |
3 |
|
|
5 |
Admin |
|
|
|
1 |
|
|
|
1 |
|
Prerequisites for Viewing and Displaying Office Documents
If you want to make use of the View File macro or to view Office documents attached to a wiki page, you need the setup described below.
Browsers and Flash Player
You can use any browser to view an Office document on a wiki page, provided that you have installed Adobe Flash Player version 9 or later. You do not need to have an Office desktop application installed on your computer, in order to view Office documents in Confluence.
Document Types
To be displayed in Confluence, the document needs to be valid Microsoft Office 97-2003 document, of the following types:
If you are using OpenOffice to create and edit the documents, you will need to save your document in Microsoft Office 97-2003 format before attaching it to a Confluence page.
Above are the prerequisites for viewing or displaying Office documents in Confluence. For a full list of Office Connector prerequisites and limitations, please refer to:
Displaying a Word Document in Confluence
Basic Usage
{viewfile:my document.doc}
Parameters Available
Parameter |
Required |
Default |
Description |
(attachment file name) |
yes |
|
This is the file name of the document to be displayed. The document must be attached to a wiki page on your Confluence site. |
page |
no |
The page which contains the {viewfile} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewfile:my document.doc|page=Sample Page}
|
space |
no |
The space of the page which contains the {viewfile} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewfile:my document.doc|space=DOC|page=Sample Page}
|
Editing the Word Document
When viewing a wiki page that displays an attached Office document, you can launch your Office editor directly from Confluence.
- Move your mouse pointer to the top of the document embedded in the Confluence page, until the hidden title bar appears. (See the screenshot below.)
- Click the title bar.
- Confirm your action and log in as prompted.
- The Office document will open in your Office application. Make any necessary changes, then save the document. It will be saved back into Confluence.
Screenshot: The title bar showing 'document.doc' above an embedded Office document
You will find detailed instructions in Editing an Office Document from Confluence.
Displaying a PowerPoint Presentation in Confluence
You can display an PowerPoint presentation on a Confluence page. By default, the presentation will be displayed as a dynamic slide show, using Adobe Flash Player. You can also choose to display just one of the slides as a static JPEG image.
Basic Usage
{viewfile:my presentation.ppt}
Parameters Available
Parameter |
Required |
Default |
Description |
(attachment file name) |
yes |
|
This is the file name of the document to be displayed. The document must be attached to a wiki page on your Confluence site. |
height |
no |
|
Specify the height of the display, in pixels (default) or as a percentage of the window's height. For example, to specify a height of 200 pixels:
{viewfile:my presentation.ppt|height=200}
This code also specifies a height of 200 pixels:
{viewfile:my presentation.ppt|height=200px}
This code specifies a height of 10 percent of the window's height:
{viewfile:my presentation.ppt|height=10%}
|
page |
no |
The page which contains the {viewfile} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewfile:my presentation.ppt|page=Sample Page}
|
slide |
no |
none |
Specify the number of the slide which you want displayed on the Confluence page, starting with '0' for the first slide. Instead of a slide show, the page will display just the single slide represented as a JPEG image. |
space |
no |
The space of the page which contains the {viewfile} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewfile:my presentation.ppt|space=DOC|page=Sample Page}
|
width |
no |
|
Specify the width of the display, in pixels (default) or as a percentage of the window's width. For example, to specify a width and height of 200 pixels:
{viewfile:my presentation.ppt|width=200|height=200}
This code also specifies a width and height of 200 pixels:
{viewfile:my presentation.ppt|width=200px|height=200px}
This code specifies a width of 10 percent of the window's width:
{viewfile:my presentation.ppt|width=10%}
|
Viewing the Slide Show and Editing the Presentation
When you view the PowerPoint presentation on a Confluence page, options on the bottom frame of the slide show allow you to:
— Download the presentation and save it onto your computer.
— Edit the presentation in your Office application. You will find detailed instructions in Editing an Office Presentation from Confluence.
— Move to the first, previous, next and last slides in the presentation. Or enter a slide number to move directly to that slide.
— Refresh the display.
— Open the presentation in full-screen mode. To return to normal viewing mode, press the escape key ('Esc') on your keyboard.
Screenshot: PowerPoint presentation embedded on a Confluence page
Displaying an Excel Spreadsheet in Confluence
Basic Usage
{viewfile:my spreadsheet.xls}
Parameters Available
Parameter |
Required |
Default |
Description |
(attachment file name) |
yes |
|
This is the file name of the document to be displayed. The document must be attached to a wiki page on your Confluence site. |
col |
no |
Last column with content |
Enter the number of the last column you want displayed, starting from '0' as the first column. For example, the following code will show the first 3 rows and the first 3 columns:
{viewfile:my spreadsheet.xls|col=2|row=2}
|
grid |
no |
true |
Set this parameter to 'false' to hide the grid lines in the display of the spreadsheet. |
page |
no |
The page which contains the {viewfile} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewfile:my spreadsheet.xls|page=Sample Page}
|
row |
no |
Last row with content |
Enter the number of the last row you want displayed, starting from '0' as the first row. For example, the following code will show the first 3 rows and the first 3 columns:
{viewfile:my spreadsheet.xls|col=2|row=2}
|
sheet |
no |
First worksheet in the spreadsheet |
Enter the name of the worksheet that you want displayed. |
space |
no |
The space of the page which contains the {viewfile} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewfile:my spreadsheet.xls|space=DOC|page=Sample Page}
|
Editing the Excel Spreadsheet
When viewing a wiki page that displays an attached Office spreadsheet, you can launch your Office editor directly from Confluence.
- Move your mouse pointer to the top of the spreadsheet embedded in the Confluence page, until the hidden title bar appears. (See the screenshot below.)
- Click the title bar.
- Confirm your action and log in as prompted.
- The spreadsheet will open in your Office application. Make any necessary changes, then save the spreadsheet. It will be saved back into Confluence.
Screenshot: The title bar showing 'spreadsheet.xls' above an embedded Excel spreadsheet
You will find detailed instructions in Editing an Office Spreadsheet from Confluence.
Displaying a PDF Document in Confluence
Basic Usage
{viewfile:my document.pdf}
Parameters Available
Parameter |
Required |
Default |
Description |
(attachment file name) |
yes |
|
This is the file name of the document to be displayed. The document must be attached to a wiki page on your Confluence site. |
page |
no |
The page which contains the {viewfile} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewfile:my document.pdf|page=Sample Page}
|
space |
no |
The space of the page which contains the {viewfile} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewfile:my document.pdf|space=DOC|page=Sample Page}
|
Viewing the PDF Document
When you view the PDF document on a Confluence page, it is displayed as a slide show. Options on the bottom frame of the slide show allow you to:
— Download the PDF file and save it onto your computer.
— Move to the first, previous, next and last pages in the document. Or enter a page number to move directly to that page.
— Refresh the display.
— Open the document in full-screen mode. To return to normal viewing mode, press the escape key ('Esc') on your keyboard.
Screenshot: PDF document embedded on a Confluence page
Troubleshooting
Problems? Please refer to our guide to the Office Connector limitations and known issues.
RELATED TOPICS
Take me back to Confluence User Guide
|