OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
660 stars 94 forks source link

Can't open this presentation because it's ennrypted when calling Office.context.document.getFileAsync #3807

Open mscc-sascha opened 8 months ago

mscc-sascha commented 8 months ago

I want to retrieve the file content of certain PowerPoint presentations using Office.context.document.getFileAsync(Office.FileType.Compressed). When I call the function within PowerPoint Online, then open the document in PowerPoint for Desktop (Windows) to call the function again and finally switch back to PowerPoint Online and call the function again, an error is displayed:

image

I couldn't reproduce this error by creating any blank presentation. The error only occurs with some examples, couldn't figure out the difference of the documents as I broke it down to the minimum.

Your Environment

Expected behavior

Getting the file content should work in the described case.

Current behavior

An error is thrown: image

Steps to reproduce

  1. Upload the attached presentation (Testpresentation.pptx) to OneDrive
  2. Call Office.context.document.getFileAsync(Office.FileType.Compressed) (I attached the GitHub Gist for Scriptlab)
  3. Open the document in Desktop App
  4. Call Office.context.document.getFileAsync(Office.FileType.Compressed) again
  5. Switch back to PowerPoint Online and press "Continue here"
  6. Call Office.context.document.getFileAsync(Office.FileType.Compressed) again --> The error is shown

For simplicity I attached a video explaining the steps to reproduce the error.

Link to live example(s)

  1. Gist on GitHub

Attachements

GavinGu07 commented 8 months ago

Thanks, @mscc-sascha for reporting this. We can repro the issue. It has been put on our backlog. We unfortunately have no timelines to share at this point.

One tricky workaround is editing the document after switching back to the PPT Online and calling getFileAsync.