How to Add an ms-word URI Scheme Link to a SharePoint Site
Question details
The user wants to create a button link on a modern SharePoint page that uses the ms-word URI scheme to open a Word document directly.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Attempting to bypass default SharePoint link restrictions to force a Word document to open in the local desktop application rather than the browser.
- Observed behavior
- Modern SharePoint rejects the button link because it generally requires standard HTTP or HTTPS URLs and blocks custom URI schemes like ms-word:.
Verify that you have site owner or admin permissions to add custom web parts to your SharePoint page, as the default Quick Links web part will reject non-HTTP/HTTPS URLs.
Use a Modern Script Editor Web Part
Since standard SharePoint links block the ms-word URI, deploying a Modern Script Editor web part allows you to inject raw HTML to create the button.
This workaround relies on custom scripting, which must be enabled in your SharePoint tenant settings.
Edit your SharePoint page, click the '+' icon to add a new web part, and select the Modern Script Editor (you may need to deploy it via the SharePoint App Catalog if it is not natively available).
Click 'Edit snippet' and paste your custom HTML code. Use the format: <a href="ms-word:ofe|u|https://your-tenant.sharepoint.com/sites/library/file.docx"><button type="submit">Open File</button></a>.
Click 'Save' on the snippet editor, then click the 'Republish' button at the top right of your SharePoint page to apply the custom link.

Use Standard SharePoint File Links
If custom scripts are blocked by your organization, use the default sharing link and let users choose to open it in the desktop app manually.
Edit Your SharePoint Documents with WPS Office
If you are downloading Word, Excel, and PowerPoint files from SharePoint and need a fast, reliable desktop application to edit them, WPS Office provides excellent compatibility without the high subscription costs of Microsoft Office.
- 1. Download and Install: Get the free WPS Office installer from the official website and follow the setup wizard.
- 2. Open Downloaded Documents: Set WPS Office as your default application to automatically open DOCX files downloaded from your SharePoint sites.
- 3. Edit and Save Seamlessly: Make your changes using familiar tools, save in standard Office formats, and re-upload to your team's document library.

Frequently Asked Questions
Why does modern SharePoint reject the ms-word URI scheme?
Modern SharePoint link web parts are built with strict security validations that typically only accept standard web protocols like HTTP, HTTPS, and mailto. Custom client application URIs like ms-word: are filtered out to prevent malicious scripts from executing local apps.
Do ms-word URI links work smoothly in all web browsers?
Not inherently. Even if you successfully add the link via a script editor, modern browsers (like Chrome or Edge) will usually prompt the user with a security popup asking for permission to open an external application (Microsoft Word) before executing the link.
Can I use similar URI schemes for Excel and PowerPoint on SharePoint?
Yes, if you use the Modern Script Editor workaround, you can replace 'ms-word:' with 'ms-excel:' or 'ms-powerpoint:' in your custom HTML anchor tag to directly launch those respective desktop applications from the web page.




