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.
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:
You will see two sections to add web parts like below:
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:
After the final selection of your selected Document library, the below screen will appear.
In the second column-section2, Click on the “+” sign. Select “File Viewer” from the web part toolbox.
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.
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:
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:
With Selected File Screen, it will appear like below:
You may like following SharePoint tutorials:
- Create Page templates in SharePoint Online Modern Experience
- How to Embed Facebook Page into SharePoint Online Modern Site Page
- SharePoint modern list column formatting examples
- Difference between SharePoint classic and modern experiences in list and library
- SharePoint 2019 modern Team site template missing while creating sub sites
- Create and set a modern page as homepage in SharePoint Online
- Create site page option missing in SharePoint Online modern sites
- Read CSV file from SharePoint document library programmatically using CSOM
- Microsoft Flow: Save my email attachments to a SharePoint document library
- Create folder in SharePoint document library using CSOM
- Does the Future with SharePoint Server or SharePoint Online?
This SharePoint tutorial, we learned, how to open selected documents from the document library in file viewer in SharePoint modern site.
Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.