Open MS Office Files in Read-Only Mode in LibreOffice
Configuring LibreOffice to open Microsoft Office files (such as DOCX, XLSX, and PPTX) in read-only mode by default helps prevent accidental modifications and maintains document integrity. This guide explains how to set up read-only access globally through system launch flags, advanced LibreOffice settings, and file open options.
Method 1: Change File Associations to Launch with the Read-Only Flag
The most reliable way to force LibreOffice to open Microsoft Office
formats in read-only mode by default is to update your operating
system’s file association commands with the --view (or
-R) parameter.
On Windows:
- Press
Win + R, typeregedit, and press Enter to open the Registry Editor. - Navigate to the file extension handler for the desired Microsoft
Office format (for example,
.docxtypically routes throughLibreOffice.DocxorApplications\soffice.exe). - Locate the
shell\open\commandkey. - Double-click the
(Default)value string. - Add
--viewbefore the file path parameter.- Example:
"C:\Program Files\LibreOffice\program\soffice.exe" --view "%1"
- Example:
- Repeat this process for other extensions (such as
.xlsxand.pptx).
On Linux:
Open or create a custom desktop entry in
~/.local/share/applications/(e.g.,libreoffice-view.desktop).Copy the contents of
/usr/share/applications/libreoffice-writer.desktop.Modify the
Execline to include the--viewflag:Exec=libreoffice --view %USet this desktop entry as the default application for Microsoft Office MIME types in your desktop environment’s settings.
Method 2: Configure Read-Only Settings via LibreOffice Expert Configuration
LibreOffice provides internal settings to control document handling and write permissions:
- Open LibreOffice.
- Navigate to Tools > Options (on macOS: LibreOffice > Preferences).
- In the left panel, expand LibreOffice and select Advanced.
- Click the Open Expert Configuration button.
- In the search bar at the top, type
ReadOnlyand press Enter. - Review the properties under
org.openoffice.Office.Common:- Look for security policies and filter flags associated with external document imports.
- Double-click Boolean properties to toggle their values as needed to restrict editing permissions for foreign file formats.
- Click OK and restart LibreOffice.
Method 3: Opening Files Manually in Read-Only Mode
If you do not want to alter system-wide associations, you can open documents in read-only mode directly from within the application:
- In LibreOffice, go to File > Open.
- Select the Microsoft Office document you wish to view.
- In the bottom-right corner of the file chooser dialog, check the Read-only box.
- Click Open.
To edit a file opened in this mode later, click the Edit
Mode button (or press Ctrl + Shift + M) on the
standard toolbar.