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
1
vote
1 answer

How to know my add-in is open in Excel task-pane Office 365?

I am creating an Office 365 plugin for Excel using Angular. I use Office-JS library to interact with Excel. My plugin appears in the Excel task-pane. I want to know that my add-in is open/close in task-pane via code, I want to know as I need to…
1
vote
1 answer

Outlook Add-In Event Listeners

I am working on an Outlook JS add-in where I take the list of Recipient Emails (To, CC) and send it to a server and return back whether or not an email is already in that user's database on a website. Is there an event listener that fires when a…
james
  • 491
  • 6
  • 15
1
vote
0 answers

Unable to call a custom URL scheme on MacOS

I am creating a PowerPoint Office-Js addin solution that depends on a native MacOS app running on the same system, which can be launched using a custom URL scheme (e.g. MyApp://doSpecificAction). When I try to open that URL in a browser on MacOs, I…
AZ007
  • 25
  • 5
1
vote
0 answers

Outlook add-in MessageCompose interface 3x slower on Outlook 2016 for Windows versus Outlook for Mac

Edit: In addition to the original question below, I am finding that every method in the MessageCompose interface gets delayed when using Outlook for Windows, versus Outlook for Mac, so it's not just the file attachment but, for example, inserting a…
1
vote
1 answer

Outlook addin On Send on dektop not firing

I have been building an office add-in for Outlook. I have a taskpane, that works fine, and yesterday, I added "on send" function. It works well on web, but it doesn't work on desktop. Mails are just sent without any notification message. According…
tombjorn
  • 55
  • 4
1
vote
2 answers

OfficeJs displayDialogAsync - check if i have an open dialog window

I have an excel add-in. I placed two content-pane from my add-in and i would like to open a dialog from it. One excel allow only one dialog window in same time. When i open a dialog window before i have an ajax request to server, but if i can not…
Péter
  • 273
  • 1
  • 10
1
vote
2 answers

Running Excel Javascript API without opening Excel?

Is it possible to run code from the Excel Javascript API without opening Excel? I'm not looking to use this in a server context, I'd just like to be able to run a Javascript script that interacts with the document from the command line. Thanks for…
Nate Rush
  • 360
  • 2
  • 14
1
vote
1 answer

Office Professional 2016 Excel Office.js Add-in Browser Issue

The Add-in was working fine under Internet Explorer 11 and I was able to reliably observe and debug its behavior in Visual Studio 2017. Recently after some automatic Windows/Office updates, I noticed that iexplore.exe was not being used as the host…
1
vote
1 answer

Office.js: Add multiple rows on Excel using Excel.Range class

I want to add multiple rows at a time to table on Excel. Right now we are adding using for loop. await Excel.run(async (ctx: Excel.RequestContext) => { sheet = ctx.workbook.worksheets.getItem('sheetName'); table =…
Amir
  • 1,855
  • 3
  • 24
  • 40
1
vote
1 answer

Word JS Api Throws “RichApi.Error: Cannot read property 'ha' of null" on insertFileFromBase64 in OfficeOnline Only

When calling insertFileFromBase64 in word online (build 16.0.12719.32656), the following error will be thrown when trying to insert some documents: Full error object: “RichApi.Error: Cannot read property 'ha' of null at new c…
Chris Nady
  • 23
  • 5
1
vote
1 answer

How to detect Outlook add-in client release version office.js

I am developing an Outlook add-in where I need to know what is the client release version like 2013, 2016, 2019, 365 etc. While I can get client version using Office.context.mailbox.diagnostics.hostVersion but it returns version like 15.0.468.0. I…
Irfan Alam
  • 476
  • 3
  • 9
  • 25
1
vote
2 answers

Is it possible to add a button on Excel sheet using Office Js Api?

I am building an Excel Addin using Office JS API. I have found a workaround to dynamically generate drop-down lists and now I am wondering whether I can add a Button on excel sheet using Excel JS API
1
vote
1 answer

Office Add-in Error when using Centralized Deployment

I am trying to deploy a Microsoft Word Office Add-in through Office 365 using centralized deployment. I created my project using the yeoman generator and VS code. After testing and running on my local machine I built to project using npm run build…
nsharma98
  • 223
  • 2
  • 14
1
vote
1 answer

Await an excel calculate full of formulas, triggered by OfficeJS

I want to execute some code after Excel finished a calculate full which I triggered myself. So currently I'm calling the calculate full this way. context.workbook.application.calculate('Full'); But it seems this just triggers Excel to calculate and…
Developer
  • 186
  • 3
  • 19
1
vote
1 answer

removing blank rows from a table using office js

I'm developing a Word Add-in (Word API + Office.js) where i am working with content controls, I am trying to read the table content inside a content control where I need remove the empty rows Sample: I have this table inside a content control I…
1 2 3
99
100