# Open with MR Office from OneDrive

Source: https://mroffice.ai/en/developers/cloud/onedrive

Open Word, Excel, PowerPoint and PDF files from OneDrive in MR Office's editors, and save them back to OneDrive as new versions.

## What it does

MR Office opens Word, Excel, PowerPoint and PDF files straight from OneDrive: select a file and choose Open → Open in MR Office (the entry appears once you have allowed MR Office for your account). The editor opens in a new tab, on the file as it is in OneDrive.

## Permissions

The first time, OneDrive asks you to allow MR Office to read and write your files (Files.ReadWrite; files shared with you from someone else's drive ask once more, for Files.ReadWrite.All). MR Office keeps that access on its server, encrypted, and uses it only to read the file you open and to write your saves back; you can remove it at any time in OneDrive's settings.

## Saving

Each save is written back to OneDrive as a new version of the same file, and OneDrive's version history keeps the earlier ones. If someone changed the file while you were editing, your save is still the newest version and their changes stay in the history. The bar above the editor says when a save has reached OneDrive.

## On your own MR Office

Running MR Office yourself? Register an app with OneDrive as below and set its keys on the API.

```text
console:        Microsoft Entra admin center (App registrations: any directory + personal Microsoft accounts)
redirect_uri:   https://office.example.com/api/v1/cloud/onedrive/callback
permissions:    openid email offline_access User.Read Files.ReadWrite Files.ReadWrite.All (delegated)
file_handler:   https://office.example.com/api/v1/cloud/onedrive/open (version 2, action open: docx xlsx pptx pdf)

ONEDRIVE_CLIENT_ID=…
ONEDRIVE_CLIENT_SECRET=…
```
