Questions tagged [office-js]

OfficeJS is the new JavaScript extensibility model for Microsoft Office client applications. You can extend Office applications that run on Windows, web, iOS, and the Mac. This model is applicable to Office client applications starting with Office 2013. Please read the tag info for additional guidance on how to increase the chance that you'll get a high quality answer to your questions.

For questions about the JavaScript and REST based Office Add-ins APIs.

Office.js is a JavaScript library developed by Microsoft and used to develop Office Add-ins (formerly Apps for Office). The library contains functions for every Office application (for example getting data selected by the user) and several objects and functions useful in the development of Outlook add-ins. The library allows you to develop three types of add-ins:

  • Content Add-ins
  • Task Pane Add-ins
  • Mail Add-ins

Content add-ins display and add-in application's contents within a window typically in the middle of an Office application. Task pane add-ins provide the add-in's content in a sidebar, and mail add-ins appear in the body.

Within the library, there are three main API's. The Shared API provides functions and objects useful to all types of add-ins. The Document API provides objects and functions useful in developing Content and Task Pane add-ins. The Mailbox API contains functions and objects useful for Mail add-in development.

Furthermore starting with Office 2016 and corresponding Office365 installations, there is a new set of richer functionality of APIs available for Excel and Word with many hundred new application specific functions available that allow developers to write rich add-ins for these applications.

Add-ins created using this library can run on any Office application regardless of device.

More information on this library may be found on dev.office.com.

When asking questions with this tag, please make sure to follow the points below

  • If you are encountering a new API error OR
  • If you are seeing issues on APIs that used to work OR
  • If you are seeing issues on APIs that are working on other devices / installations of Office

Make sure you to include your Office build version in the question.

should not be used for questions relating to Office Add-ins created using Visual Studio Tools for Office (VSTO) which have their own tag:

5489 questions
9
votes
1 answer

How to download a file within a TaskPane App without using window.open()?

I have an application which shows some static files for download. This application creates an hidden iframe and set the source to the file-url. The browser shows a save-as dialog. But within Microsoft Office there is no save-as dialog and the…
Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79
9
votes
3 answers

How to test Office Add-ins in the online version of Word and excel?

I am developing an Task Pane Office Add-in using the Office JavaScript APIs in Visual Studio. When you run the application it runs in the desktop client version of Office. The Office Store requirements states Your Add-in for Office must be fully…
Shiva
  • 6,677
  • 4
  • 36
  • 61
9
votes
1 answer

Neat ways to get environment (i.e. Office version)

Unfortunately, some features of the office API do not behave exactly the same in all environments (example: formatting in Excel Online and Excel 2013). Additionally, some nice new features are not available in Excel 2013 but are available in Excel…
Ar Es
  • 389
  • 3
  • 12
8
votes
0 answers

Could individual developer publish office web add-in

Is it possible for individual developer account to publish office web add-in to AppSource, like outlook web add-in? By this article or here, it says that individual developer account can publish office web add-in to Office App Store. However, when I…
8
votes
1 answer

Set CustomProperties on appointment for all attendees

tl;dr When setting CustomProperties to an appointment that has attendees, only the appointment for the organizer gets the CustomProperties. The properties do not propagate to the appointments of the other attendees. Longer version When we create…
Andy T
  • 10,223
  • 5
  • 53
  • 95
8
votes
2 answers

Disable the automatic conversion to Date

In one workbook (from somebody else) that I need to analyse, they use a formula to construct a list of strings: 04-09-01, 04-09-02, 04-09-03, etc, which have general as format. In a part of my code, I will need to copy these values to somewhere…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
8
votes
2 answers

How can a range be used across different Word.run contexts?

I have created a taskpane addin for word that runs a search and displays information about the results as a list to the user. When the user clicks on an item in the list I want to select the range in word to show the user the location of the…
Tom Waddell
  • 129
  • 1
  • 5
8
votes
3 answers

How to get username, email address, filename from task pane app

I cam trying to get the following information from the task pane app (Office Add-ins): User information ie. username, email address Filename of the current open document I'm currently developing an task pane add in for Word, Excel and PowerPoint,…
user5501201
  • 245
  • 3
  • 10
8
votes
1 answer

Add images as multipart/related MIME object to Outlook with Office Js Addin

I'm using addFileAttachmentAsync to add an image as an attachment to an email in outlook 2016. Is there a way to specify attachment options? I saw that there is an AttachmentDetail type, can I somehow use this one to specify additional options? My…
Atti
  • 160
  • 10
8
votes
1 answer

JavaScript interaction with PowerPoint documents

I have a task pane add-in for PowerPoint in mind that can help users with tasks on the active presentation. With Microsoft Office becoming more and more popular on platforms besides Windows using the JavaScript API would make a great portable…
Paul B.
  • 2,394
  • 27
  • 47
7
votes
1 answer

Excel Javascript Add-in: how to open ExecuteFunction in the taskpane rather than new iframe?

I'm trying to use the Excel Javascript API to create an addin that: Adds multiple buttons on the Home tab. Each of the buttons opens the taskpane to a different screen. Each of these taskpanes runs in the same runtime (e.g. I can share data…
Nate Rush
  • 360
  • 2
  • 14
7
votes
2 answers

How do I add a bookmark within the body of a Word doc using Office JS

The Office JS has provided the following function in preview, but I couldn't find any example. Here is what I tried but it doesn't seem to work, any idea what I am missing here, since this code inserts the text but the bookmark is not…
Baig
  • 1,489
  • 1
  • 25
  • 41
7
votes
2 answers

Debugging Outlook Add-in Desktop

I'm currently developing an Add-in using yeoman and generator-office for Outlook to save an email and its attachments to another service. Outlook Version: MS Office Professional Plus 2016 v.16.0.48.49.1000 I am able to sideload the add-in by going…
Lumpenstein
  • 1,250
  • 1
  • 10
  • 27
7
votes
2 answers

Which preferred IDE for Office JS Excel addins

I am trying to develop add-ins for Excel with the Microsoft JS API. I have read the book from Michael Zlatkovsy about building office add-ins using Office.JS. but it is a very steep learning curve (having some background on VB 6, C, C# and Java.…
g00golplex
  • 397
  • 1
  • 6
  • 17
7
votes
4 answers

Getting "office-addin-debugging is not recognized as an internal or external command" after running an Excel task pane project with yo office

I am unable to start an office-js Excel Task pane Add-in project due to "office-addin-debugging" apparently being missing. However, I noticed the module is included in my dev-dependencies. I followed the example tutorial on the official website. The…
Olalekan
  • 185
  • 1
  • 10