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

Delete and replace sheet without destroying references to it in Excel Javascript

Here's what I'm trying to accomplish using the Excel Javascript API: I have a Sheet1 and Sheet2 in my workbook. Within Sheet2 there may be some references to cells in Sheet2, but I don't know where or even if they exist. I'd like to replace Sheet1…
Nate Rush
  • 360
  • 2
  • 14
1
vote
0 answers

Searching text on tracked paragraph with matchCase or matchWholeWord returns wrong ranges in officeJs word online

When a search operation is performed on trackedobjects(paragraph) with search options(matchCase/matchWholeWord) always the first instance is returned. this can be confirmed by doing any font color change on returned range. example paragraph : For…
Manohar
  • 31
  • 1
  • 6
1
vote
1 answer

Excel chart.style name lookup

For some reason the Excel chart.style property is only returning a number not the name of the style. Is it possible to retrieve the applied style name of the chosen chart with the name being returned? If not, is there a function to look up the name…
jmadd
  • 115
  • 1
  • 1
  • 6
1
vote
1 answer

Can Microsoft Word add-in developed in office.js support Mobile Word app ? (I knew outlook add-ins has support for mobile)

we are working on making Microsoft word add-in using office.js and other additional technologies. As we are looking for generic project, i have query whether is there way / does Word Add-ins supports in Mobile Microsoft word app (Android/Mac).
1
vote
1 answer

Office-JS Addin having problems in multiple opened Excel

I have some problems when i use my Angular Excel Addin (Office js) in multiple opened Excel instances. Before I describe the problem in more detail, I would like to give a short explanation of what the AddIn does: The user can define UDF functions…
Marco Siebert
  • 109
  • 10
1
vote
1 answer

Test Office Add-ins

I have developed an Office add-in for Excel and would now like to test it under production conditions before it is deployed and published in AppSource. Is there any way to test the add-in under production conditions? The only thing I have found so…
Marco Siebert
  • 109
  • 10
1
vote
1 answer

Multiple Word/Office Add-ins interacting

I am designing a Word add-in which has an "search" interface, and my user will want open several of the "search results" in new tabs (or similar UX) to see additional information about each search result. They will want to open each new result in a…
James
  • 118
  • 1
  • 10
1
vote
1 answer

Couldn't load cell value for more than 12000 rows in Excel using Office js Excel API

We have created an Excel addin using office js API. In our extension we have a module where we fetch data from excel sheet and then process it. The implementation works fine upto 12000 rows after which the API returns 500 internal server error. I…
naveen ashok
  • 311
  • 1
  • 16
1
vote
1 answer

How to ensure that Excel Online request is less than 5MB using Office JavaScript API

Apparently there is a 5MB limit when making requests in Excel Online (see: https://github.com/OfficeDev/office-js-docs-reference/issues/354). We are using the Office JavaScript API to write large amounts of data into an Excel worksheet, using the…
extremeandy
  • 503
  • 3
  • 13
1
vote
1 answer

Using "addFromBase64" function to add existing workbook

I have created excel add-in using office.js. In my add-in, I need to open an existing workbook in my current workbook. I looked into Office.js api’s docs and found that I can achieve my requirement using “addFromBase64” function. They also noted…
umesh shukla
  • 139
  • 3
  • 13
1
vote
0 answers

I get this error when try to discard change of new appointment on outlook online

I got a Uncaught (in promise) TypeError When I try to: go to outlook online https://outlook.office365.com/ > calendar > select datetime open new appointment window > set Repeat = Every day open my add-in > a task pane with my add-in content…
1
vote
1 answer

Date not properly showing as per example

i have used sample demo like below code var Table = sheet.tables.add("A1:D1", true); Table.getHeaderRowRange().values = [["Date", "Merchant", "Category", "Amount"]]; Table.rows.add(null /*add rows to…
jeshal
  • 19
  • 3
1
vote
0 answers

OfficeJs getUserIdentityTokenAsync failed to generate the token

One of our customers faced an issue while using our Add-in for Microsoft Office. When we call getUserIdentityTokenAsync it fails with an error {"value":null,"status":"failed","error":{"name":"InternalServerError","message":"The Exchange server…
1
vote
1 answer

Post data to server using Excel Add-in

The Project is an Excel Web Add-in. I am currently running the add-in on Visual Studio in debug mode and would like to post data to the server. The data is sent through an ajax call. Code for Posting data: Excel.run(function (context) { let…
1
vote
2 answers

Is there a way to delete a section break in Word-js?

I am writing a Word add-in using office-js that generates an index. It uses the following code to create a section break at the end of the document, and then writes the index there: function WriteIndex() { Word.run(function (context) { // …
Ned Balzer
  • 35
  • 6