Learn how the Office.js libraries allow us to interact with the document.
- [Instructor] Remember I said that we can easily get to the contents of the document we are working on. We do this through the Office.js API. Which is the bridge to the current document. This is a java script library that gives us a rich set of functions to get and set the content of the document. In fact, it is the initialized method of the Office.js API that we are going to override in order to be able to start running our code when the add-in starts. And if, by the way, we don't respond promptly, within five seconds the framework will shut our add-in down so we shouldn't start any long initialization process or calculation, just return straight away.
Once we have called the initialized method, we might want to check for the support if using UI Office.js capabilities. Using the requirements is set supported operation. Some of the APIs are generic, but a lot are specific for each Office application and many of them follow this pattern where we get context using the run method. You then get a context to load properties you need to work with. Then, call the context Sync method to execute a batch of operations.
Then, call the context Sync method to execute a batch of operations and use the return promise to get results for a previous operation and perform any new operations and, of course, catch any errors. We'll talk more about Office.js later in the course, but this shows a fraction of the API surface for version 1.1 of Word. Don't worry too much about the details, but you can see that a lot of the functionality of the Office applications is exposed.
The intention is that anything you can do with the UI should be possible through the API, but this is a longterm goal for the Office add-ins development team. Although these APIs are already very powerful, there is still a long way to go.
- How Office extensions work
- Using the Office.js libraries
- Working with ScriptLab
- Creating an add-in with Visual Studio
- Working with manifests and commands
- Deploying and debugging add-ins
- Developing new add-in controls
- Working with Yeoman, Angular, and React
- Sideloading add-ins to different locations
- Guidelines for designing add-ins
- Using Office application APIs
- Publishing and licensing add-ins
Skill Level Intermediate
What are Office add-ins?2m 34s
1. Getting Started
2. Building Add-Ins with Visual Studio
3. Using Other Libraries and Tooling with Add-Ins
4. Add-Ins for Word, PowerPoint, and OneNote
5. Add-Ins for Excel
6. Add-Ins for Outlook
7. Distributing Your Add-In
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.