Open a document in View mode by default- SharePoint

Anonymous
2022-01-04T23:20:48+00:00

Is there a way to open Word, Excel, or Powerpoint documents in 'Viewing' mode by default? When I open a document it opens by default in 'Edit' mode. Opening in Edit mode does not accurately display file formatting and headers and footers are not visible.

Ideally, I'd like the document to open in "Viewing" by default to ensure formatting, headers and footers are displayed correctly.

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2022-01-05T00:53:48+00:00

    Hi TanyaSPG,

    Thanks for sharing updates with us and I really appreciate your effort and your precious time doing those tests. First, please accept my apologize you meet such an issue and I understand it effort on your daily work.

    We appreciate your understanding that sometimes the initial suggestions may not resolve the problem very soon. However, we can work together to narrow down and resolve the situation

    Regarding to, "If I was to use solution 4, is it possible to also have the ability to 'edit' the document?" if you wish to use Solution 4, and also want user the ability to Edit document as well, the you may use below JSON code in update your column (File column).

    {
       "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
       "elmType": "a",
       "txtContent": "@currentField",
       "attributes": {
          "target": "_blank",
          "href": "=if(indexOf([$ContentTypeId], '0x0120') >= 0, '?id=' + [$FileRef], @currentWeb + '/_layouts/15/Doc.aspx?sourcedoc='+ [$UniqueId] + '&action=View')"
       }
    }
    

    Note: When user click on stored document in SharePoint online document library, it will open in View mode however in the top of document bar have "Edit button" click on it when users want to edit document.

    Image

    I appreciate your understanding and stay safe!!

    Best Regards

    Waqas Muhammad

    17 people found this answer helpful.
    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2022-01-05T00:17:26+00:00

    Hi TanyaSPG,

    As per your description, please don’t worry we can work together to narrow down and resolve the situation.

    Generally, when we click a Word, Excel or PowerPoint file in SharePoint online and OneDrive for Business or open a sharing link to a Word, Excel or PowerPoint file in your browser, we will open directly into edit mode, allowing you to jump into work faster than ever.

    Since you concern, open Office 365 file document “View only” mode by default instead of “Edit “mode.  In my opinion to meet your requirement, here are some solution for you(you can chose).

    Solution1:

    You can set “Require documents to be checked out before they can be edited“to Yes in Version settings in Library Settings. In this scenario when you and users will open the document (stored in SharePoint online document library) in View/read only mode. See image below for your reference:

    Result view:

    Solution2:

    Also, your needs could be achieved via SharePoint, give yourself read-only permissions. For example, in SharePoint Online, go to site setting> permission - create a new group (read only) - add yourself or other users to this group - after these steps, users will open the document (stored in SharePoint online document library) in read only mode.

    Solution3:

    If you can open the document at Desktop App (Word, Excel, etc) before uploading at SharePoint. Then you can set the document to open as Read-Only.

    Solution4:

    You can achieve setting the default to 'View" mode by using SharePoint Column Formatting.

    Simply update your column (File column) with the following json and your documents will now open in Preview instead of Edit:

    {"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json","elmType": "a","txtContent": "@currentField","attributes": {"target": "_blank","href": "=if(indexOf([$ContentTypeId], '0x0120') >= 0, '?id=' + [$FileRef], [$ServerRedirectedEmbedUrl])"}}

    Result preview view:

    I appreciate your understanding and stay safe!!

    Best regards

    Waqas Muhammad

    13 people found this answer helpful.
    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2022-01-07T07:07:22+00:00

    Hi TanyaSPG,

    May I know have any updates regarding to this issue? Feel free to post back if you need further assistance.

    Best Regards,

    Waqas Muhammad

    6 people found this answer helpful.
    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-03-23T19:35:51+00:00

    Hi Waqas,

    I am wondering if you can provide some assistance on topic in this thread? I have used your JSON code below on column formatting. Office documents open perfectly in Viewing mode (with option to select Editing); however I cannot open PDF files at all. When a PDF file name is clicked the document library with list of documents is displayed instead of the PDF file being displayed. It probably has to do with the "href" statement but I am so new to JSON (right now I just copy and paste things that others suggest). Can you please help? Thanks in advance for any assistance.

    {

    "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",

    "elmType": "a",

    "txtContent": "@currentField",

    "attributes": {

     "target": "\_blank",       
    
     "href": "=if(indexOf([$ContentTypeId], '0x0120') >= 0, '?id=' + [$FileRef], @currentWeb + '/\_layouts/15/Doc.aspx?sourcedoc='+ [$UniqueId] + '&action=View')"    
    

    }

    }

    Jennifer

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2022-03-24T19:18:16+00:00

    I was having the same issues and decided to use print to pdf file. My files saved in a .pdf format open with the original format when created in .docx,, .pptx., xlxs., etc. Now when I, or the members of my teams and channels, open any of the files they open in the format originally created.

    1 person found this answer helpful.
    0 comments No comments