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}


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}

Prerequisites for Viewing and Displaying Office Documents

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,

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)

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.

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,

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)

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:

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,

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)

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.

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,

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)

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:

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's Guide.