2

Is it possible to use the preview API in a offline environment? I means, something like to reference locally the library.

Thank you for your time.

Best regards

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
FranchoZGZ
  • 61
  • 1
  • 4

1 Answers1

2

Yes, it is possible if you download the latest office.js version locally. To use preview APIs:

  • You must reference the beta library on the CDN (https://appsforoffice.microsoft.com/lib/beta/hosted/office.js). The type definition file for TypeScript compilation and IntelliSense is found at the CDN and DefinitelyTyped. You can install these types with npm install --save-dev @types/office-js-preview.
  • You may need to join the Office Insider program for access to more recent Office builds.

Read more about that in that in the Word JavaScript preview APIs article.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • While technically true, OfficeJS Add-ins are designed to run online as they are basically websites running in the TaskPane (The manifest file provides the host, Word in this case, where to find the web page). To run offline you should have some sort of a PWA implementing an offline scenario or run a 'server' on your local machine hosting the Web App. – Maarten van Stam Jan 15 '22 at 18:11
  • @MaartenvanStam I am aware of that. BTW Glad to see you at SO! – Eugene Astafiev Dec 31 '22 at 11:43