File viewer web part in SharePoint Online modern site

This SharePoint tutorial, we will discuss file viewer web part sharepoint online and how to open selected documents (Word, Excel, PowerPoint, and PDF) in file viewer web part in SharePoint modern site.

In one of my previous article, I have explained, how to open Office Web Apps (Word, Excel, PowerPoint) documents in Iframe in the SharePoint Online document library.

Here, let us see about using modern web parts in SharePoint Online modern experience, and how to view the selected documents without any customization using File Viewer.

Users may not be able to open documents from SharePoint document library on their client machine. Unfortunately, the default content provides a link which only allows users to download the document and provides a link back to the document file and open in the new tab of the browser window. We must find the downloaded document in a manual fashion.

File viewer web part in SharePoint Online

The requirement is to open the selected document without downloading on a local machine and open it in a new tab of the browser window and this should be achieved using Modern in OOB web parts.

The below OOB SharePoint Online modern web parts will be used in this solution.

  • Document library – Show document library files
  • File Viewer – The web part will allow users to view files directly on the page without needing to open the file.

Follow the below steps to configure File Viewer web part in SharePoint Online modern experience.

Open your SharePoint Online modern site -> Create a Modern Page in Site Pages.

Then Edit the page. Hover over the canvas where you would like to add layout section. Click on the “+” Sign. Then add New section “Two Column” from the Section layout like below:

file viewer web part sharepoint online

You will see two sections to add web parts like below:

sharepoint modern document library web part

Now, in the first column-section1, Click on the “+” sign. Select “Document library” from the web part toolbox. Then Select the relative document library from the list of document libraries like below:

file viewer web part in sharepoint online

After the final selection of your selected Document library, the below screen will appear.

sharepoint file viewer web part

In the second column-section2, Click on the “+” sign. Select “File Viewer” from the web part toolbox.

sharepoint modern file viewer web part

After you select the File Viewer Modern Web part, the below screen appears. Edit the File Viewer Web part, Click on the … sign on right upper corner of file viewer web part toolbox. Then, click on the “Connect to Source” button.

sharepoint modern file viewer web part size

Select the same document library name from the dropdown which we had selected in the first section web part. Click on “Republish” button like below:

how to use file viewer web part sharepoint online

Now, Select any File from the left side of SharePoint document library, The file should be opened in the right side File viewer web part in SharePoint.

Without Selected any file, the screen will appear like below:

how to use the File viewer web part in sharepoint online

With Selected File Screen, it will appear like below:

SharePoint Online Modern File Viewer web part

You may like following SharePoint tutorials:

This SharePoint tutorial, we learned, how to open selected documents from the document library in file viewer in SharePoint modern site.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

  • >