Share via

Can SharePoint online open Office files in "Viewing" without affecting PDFs?

Anonymous
2024-03-19T18:45:23+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. Ideally, I'd like the document to open in "Viewing" by default to ensure formatting, headers and footers are displayed correctly.

I used the solution (below) offered to same question but it caused PDFs to stop working (files won't open). Can SharePoint online open Office files in "Viewing" without affecting PDFs?

Name column format with:

{
   "$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')"
   }
}
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

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-03-20T12:31:15+00:00

    Hi jmhelo,

    Thanks for posting in the community. We are happy to help you.

    I've tried to modify the JSON code, but I can't get the JSON code to distinguish between pdf files and non-pdf files. I am afraid that I have no idea how to meet your needs. Since your query is about the JSON code and we have a specific channel Microsoft Q&A Community coping with such development and customization questions, I suggest you post a new thread (assign the tabs SharePoint Development and SharePoint) there for expert help. See if the experts there have any ideas about what you need.

    Also, we welcome community members to share ideas about the situation if one has related experiences.

    Appreciate your understanding and patience.

    Sincerely,

    George | Microsoft Community Moderator

    0 comments No comments
  2. Anonymous
    2024-03-19T23:52:56+00:00

    Dear,

    Good morning!

    Thanks for posting in the Microsoft Community. We're happy to help. We're looking into your situation and will update you soon.

    Appreciate their patience and understanding and thank them for their time and cooperation.

    Sincerely

    Stacey

    0 comments No comments