3

As per this link the beta versions are in the dist folder under the package. but how do i refence this file in my project?

Joseph Abraham
  • 347
  • 4
  • 10
  • Could you share with us how your project is set up? Do you use npm to manage dependencies? Do you have access to an html file where you can add ` – Chuanqi Sun Jul 03 '18 at 05:03
  • @evenstar I created the project using `create react app` and generated the scaffolding using `yo office` [yeoman office generator](https://github.com/OfficeDev/generator-office). I selected the typescript option while generating. And webpack is used. – Joseph Abraham Jul 04 '18 at 07:32

1 Answers1

0

Click here to open a related guide on how to update the app after you installed the office.js

Note that the guide pulled the library into public/index.html from CDN so you don't have to install it via NPM. Maybe use this technique to get started first?

<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>

Since the office.js file injects directly into the global scopes, you can access the APIs from the window object. You can find details in that guide.

window.Office.doSomething()
window.Excel.doSomething()
window.Word.doSomething()
Chuanqi Sun
  • 1,123
  • 14
  • 26