- 開發者首頁
- 從 Google Drive 用 MR Office 開啟
從 Google Drive 用 MR Office 開啟
在 MR Office 的編輯器中開啟 Google Drive 裡的 Word、Excel、PowerPoint 和 PDF 檔案,並以新版本儲存回 Google Drive。
功能
MR Office 可以直接從 Google Drive 開啟 Word、Excel、PowerPoint 和 PDF 檔案:先從 Google Workspace Marketplace 安裝 MR Office,然後在檔案上按右鍵,選擇「開啟工具 → MR Office」。編輯器會在新分頁中開啟,內容就是 Google Drive 裡的那份檔案。
權限
第一次使用時,Google Drive 會請你允許 MR Office 只檢視和修改你用它開啟的檔案(Google 的 drive.file 權限)。MR Office 將這份授權加密保存在伺服器上,只用來讀取你開啟的檔案、將你儲存的內容寫回;你可以隨時在 Google Drive 的設定中取消。
儲存
每次儲存,檔案都會以同一個檔案的新版本寫回 Google Drive,Google Drive 的版本記錄會保留先前的版本。如果你編輯期間有人改過這個檔案,你儲存的仍是最新版本,對方的修改會留在版本記錄中。編輯器上方的列會顯示儲存何時到達 Google Drive。
在你自己部署的 MR Office 上
自行部署 MR Office?依照下方方式在 Google Drive 註冊一個應用程式,並將它的金鑰設定到 API。
console: Google Cloud console (Google Drive API, OAuth consent screen, OAuth client: Web application)
redirect_uri: https://office.example.com/api/v1/cloud/google/callback
scopes: openid email https://www.googleapis.com/auth/drive.file
drive_ui_open: https://office.example.com/api/v1/cloud/google/open
mime_types: docx xlsx pptx pdf (application/vnd.openxmlformats-officedocument.*, application/pdf)
GOOGLE_DRIVE_CLIENT_ID=…
GOOGLE_DRIVE_CLIENT_SECRET=…