This page last changed on Nov 02, 2009 by ggaskell.
The view file macro allows you to embed an Office or PDF document into your Confluence page. First attach the document to a wiki page and then use 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.
The view file macro provides several unique parameter options for some of the types of files it handles. Hence, to simplify its use, the view file macro is separated into the following four macros in the macro browser:
On this page:
Basic Usage without the Macro Browser
To use the view file macro without the macro browser, enter it directly in the Wiki Markup or Rich Text editors based on one of the following examples, along with any parameters (described below) that suit the type of file.
{viewdoc:name=my document.doc}
{viewppt:name=my presentation.ppt}
{viewxls:name=my spreadsheet.xls}
{viewpdf:name=my document.pdf}
 | Editing 'older style' {viewfile} macros
In Confluence 3.0, the {viewfile} macro's syntax was changed to be file type-specific (as indicated by the examples above). If your Confluence site was upgraded to Confluence 3.0 and you had existing content which used the 'older style' syntax for this macro ({viewfile}), you can still edit these macros via the macro browser. Just place your cursor inside the viewfile macro's braces and click the macro browser icon to edit it. The 'edit only' version of the view file macro will open in the macro browser, allowing you to edit its specific parameters. |
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 |
{viewxls:name=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
Usage with the Macro Browser (doc)
To insert the Office Word macro into a page using the Macro Browser,
- Open your desired Confluence page, then click the 'Edit' button. The 'Edit Page' mode opens.
- Next, click the Macro Browser icon
on the editor toolbar. The Macro Browser will open in the middle of the screen.
- In the Macro Browser, type the name of your desired macro into the search box at the top right of the window. Macros with a matching name will appear in the centre pane. Click on the desired macro to see its options screen. Here, you can set the macro parameters then click 'insert' to put the macro into the page.
Once you have found the Office Word macro and have added the required parameter values, click ' insert' to add it to your page.
Basic Usage with the Wiki Markup Editor (doc)
{viewdoc:name=my document.doc}
Parameters (doc)
Parameters are settings for Confluence macros that allow the user to control their content or presentation. The table below lists relevant parameters for this macro.
Parameter names are displayed differently in the macro browser interface and in wiki markup. Below, parameter names used in the macro browser are indicated in Bold text, while their equivalents in wiki markup are indicated in (bracketed) text. If the latter is not shown, then in wiki markup, the parameter's name should be omitted and only its value should be added immediately after the colon symbol (:).
Parameter |
Required? |
Default |
Description |
File Name
(name) |
yes |
none |
The file name of the Office Word document to be displayed. The document must be attached to a wiki page on your Confluence site. |
Page Name
(page) |
no |
The page which contains the {viewdoc} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewdoc:name=my document.doc|page=Sample Page}
|
Space Key
(space) |
no |
The space of the page which contains the {viewdoc} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewdoc:name=my document.doc|space=DOC|page=Sample Page}
|
Date
(date) |
no |
none |
If the Page Name refers to a blog post instead of a conventional page, enter the date of the post in the form mm/dd/yyyy. |
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.
Usage with the Macro Browser (ppt)
To insert the Office Powerpoint macro into a page using the Macro Browser,
- Open your desired Confluence page, then click the 'Edit' button. The 'Edit Page' mode opens.
- Next, click the Macro Browser icon
on the editor toolbar. The Macro Browser will open in the middle of the screen.
- In the Macro Browser, type the name of your desired macro into the search box at the top right of the window. Macros with a matching name will appear in the centre pane. Click on the desired macro to see its options screen. Here, you can set the macro parameters then click 'insert' to put the macro into the page.
Once you have found the Office Powerpoint macro and have added the required parameter values, click ' insert' to add it to your page.
Basic Usage with the Wiki Markup Editor (ppt)
{viewppt:name=my presentation.ppt}
Parameters (ppt)
Parameters are settings for Confluence macros that allow the user to control their content or presentation. The table below lists relevant parameters for this macro.
Parameter names are displayed differently in the macro browser interface and in wiki markup. Below, parameter names used in the macro browser are indicated in Bold text, while their equivalents in wiki markup are indicated in (bracketed) text. If the latter is not shown, then in wiki markup, the parameter's name should be omitted and only its value should be added immediately after the colon symbol (:).
Parameter |
Required? |
Default |
Description |
File Name
(name) |
yes |
none |
This file name of the Office Excel document to be displayed. The document must be attached to a wiki page on your Confluence site. |
Height
(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:
{viewppt:name=my presentation.ppt|height=200}
This code also specifies a height of 200 pixels:
{viewppt:name=my presentation.ppt|height=200px}
This code specifies a height of 10 percent of the window's height:
{viewppt:name=my presentation.ppt|height=10%}
|
Page Name
(page) |
no |
The page which contains the {viewppt} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewppt:name=my presentation.ppt|page=Sample Page}
|
Slide Number
(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 Key
(space) |
no |
The space of the page which contains the {viewppt} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewppt:name=my presentation.ppt|space=DOC|page=Sample Page}
|
Width
(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:
{viewppt:name=my presentation.ppt|width=200|height=200}
This code also specifies a width and height of 200 pixels:
{viewppt:name=my presentation.ppt|width=200px|height=200px}
This code specifies a width of 10 percent of the window's width:
{viewppt:name=my presentation.ppt|width=10%}
|
Date
(date) |
no |
none |
If the Page Name refers to a blog post instead of a conventional page, enter the date of the post in the form mm/dd/yyyy. |
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
Usage with the Macro Browser (xls)
To insert the Office Excel macro into a page using the Macro Browser,
- Open your desired Confluence page, then click the 'Edit' button. The 'Edit Page' mode opens.
- Next, click the Macro Browser icon
on the editor toolbar. The Macro Browser will open in the middle of the screen.
- In the Macro Browser, type the name of your desired macro into the search box at the top right of the window. Macros with a matching name will appear in the centre pane. Click on the desired macro to see its options screen. Here, you can set the macro parameters then click 'insert' to put the macro into the page.
Once you have found the Office Excel macro and have added the required parameter values, click ' insert' to add it to your page.
Basic Usage with the Wiki Markup Editor (xls)
{viewxls:name=my spreadsheet.xls}
Parameters (xls)
Parameters are settings for Confluence macros that allow the user to control their content or presentation. The table below lists relevant parameters for this macro.
Parameter names are displayed differently in the macro browser interface and in wiki markup. Below, parameter names used in the macro browser are indicated in Bold text, while their equivalents in wiki markup are indicated in (bracketed) text. If the latter is not shown, then in wiki markup, the parameter's name should be omitted and only its value should be added immediately after the colon symbol (:).
Parameter |
Required? |
Default |
Description |
File Name
(name) |
yes |
none |
This is the file name of the document to be displayed. The document must be attached to a wiki page on your Confluence site. |
Last Column
(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:
{viewxls:name=my spreadsheet.xls|col=2|row=2}
|
Show Grid?
(grid) |
no |
true |
Select the check box in the macro browser (true in Wiki Markup) to show grid lines around each cell of the Excel spreadsheet. Clear the check box in the macro browser (false in Wiki Markup) to hide these grid lines. |
Page Name
(page) |
no |
The page which contains the {viewxls} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewxls:name=my spreadsheet.xls|page=Sample Page}
|
Last Row
(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:
{viewxls:name=my spreadsheet.xls|col=2|row=2}
|
Worksheet Name
(sheet) |
no |
First worksheet in the spreadsheet |
Enter the name of the worksheet that you want displayed. |
Space Key
(space) |
no |
The space of the page which contains the {viewxls} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewxls:name=my spreadsheet.xls|space=DOC|page=Sample Page}
|
Date
(date) |
no |
none |
If the Page Name refers to a blog post instead of a conventional page, enter the date of the post in the form mm/dd/yyyy. |
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
Usage with the Macro Browser (pdf)
To insert the View PDF macro into a page using the Macro Browser,
- Open your desired Confluence page, then click the 'Edit' button. The 'Edit Page' mode opens.
- Next, click the Macro Browser icon
on the editor toolbar. The Macro Browser will open in the middle of the screen.
- In the Macro Browser, type the name of your desired macro into the search box at the top right of the window. Macros with a matching name will appear in the centre pane. Click on the desired macro to see its options screen. Here, you can set the macro parameters then click 'insert' to put the macro into the page.
Once you have found the View PDF macro and have added the required parameter values, click ' insert' to add it to your page.
Basic Usage with the Wiki Markup Editor (pdf)
{viewpdf:name=my document.pdf}
Parameters (pdf)
Parameters are settings for Confluence macros that allow the user to control their content or presentation. The table below lists relevant parameters for this macro.
Parameter names are displayed differently in the macro browser interface and in wiki markup. Below, parameter names used in the macro browser are indicated in Bold text, while their equivalents in wiki markup are indicated in (bracketed) text. If the latter is not shown, then in wiki markup, the parameter's name should be omitted and only its value should be added immediately after the colon symbol (:).
Parameter |
Required? |
Default |
Description |
File Name
(name) |
yes |
none |
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 Name
(page) |
no |
The page which contains the {viewpdf} macro |
Enter a page name, if you wish to display a document which is attached to another Confluence page. For example:
{viewpdf:name=my document.pdf|page=Sample Page}
|
Space Key
(space) |
no |
The space of the page which contains the {viewpdf} macro |
Enter a space key, if you wish to display a document which is attached to a page in another Confluence space. For example:
{viewpdf:name=my document.pdf|space=DOC|page=Sample Page}
|
Date
(date) |
no |
none |
If the Page Name refers to a blog post instead of a conventional page, enter the date of the post in the form mm/dd/yyyy. |
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 the Confluence User Guide.
|