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

Can you reference a worksheets codename in an Office Add-in?

I'm working with Office Add-ins in VS and trying to get a worksheets codename. Every example I've found only uses the text name of a worksheet. Is there a way to find/use the codename?
Zack Barresse
  • 239
  • 1
  • 11
1
vote
0 answers

Is it possible to create an Excel custom function to autocomplete strings using an API?

I'm building an Excel add-in to interact with a few APIs that serve data on plant species. One of the things I want to implement is a custom function that auto-completes species names as I type from the suggestions of an HTTP response. I want to…
1
vote
1 answer

How to get an Excel cell fill color caused by conditional formatting using office-js

I'm setting conditional formatting using the Excel Javascript API that does different types of error checking. For example, if a user enters anything other than "foo" or "bar" in range A1:A10, then the conditional formatting will highlight the cell…
jazcar
  • 13
  • 3
1
vote
1 answer

How to create table relationships in office js?

I am creating an excel js add-on, but I cannot find a way to relate tables with their respective primary and secondary keys. I need your help
1
vote
2 answers

Is it possible to merge cells of different rows e.g. A1:C2 using Excel JS Api?

I am able to merge cells of the same row using Excel JS Api like this let B2F2cellRange = sheet.getRange("B2:F2"); B2F2cellRange.merge(true); But once I try to merge an area like this: sheet.getRange("B2:F3") it fails. Any idea? Is it a limitation…
1
vote
0 answers

How to add custom properties on docx files in ruby

I am trying to figure out how to properly add custom properties to .docx files programmatically in ruby. I also have an office-js add in which reads these custom properties - but more on that later. Here are the steps I am currently taking to add…
FrostyOnion
  • 856
  • 7
  • 10
1
vote
1 answer

How to create an Outlook plugin that shows new folders from a non-exchange hosts

We're looking to create an Outlook COM or Web addin that will display additional folders in the inbox/folders section of outlook. The data will come from a Rest Webservice. We know its possible since we've seen in a legal application plugin for…
mbalsam
  • 611
  • 1
  • 6
  • 16
1
vote
1 answer

SharpApp and Office JS API

I am working with SharpApp. I have created the SharpApp using the Parcel template. Now I am trying to integrate/develop the Excel Web Add-In using Office JS API. But when I run the application I got this error in the browser dev tool…
Jamil
  • 117
  • 6
1
vote
1 answer

Office-addin review comments

Got below review comments from Microsoft team General Content 1100.1.3 Additional Charge Disclosures Offer descriptions must notify users in the description of any extra charges to use advertised features or to activate additional features or…
1
vote
1 answer

Underline doesn't display in Ooxml

I am debugging a Word office js add-in. One thing that it needs to do is create a hidden section in the word document. To do this, I pass in some information to a javascript function that creates an OoXML string. I give the user the ability to embed…
Ned Balzer
  • 35
  • 6
1
vote
1 answer

Shared Mailbox OWA Inconsistent Behavior

There are two ways of opening Shared Mailbox in OWA, Clicking on your user profile, and select "Open another mailbox" Right-clicking on your Folders, and select "Add shared mailbox" Based on the documentation,…
zevitc
  • 40
  • 6
1
vote
0 answers

Service-side breaking change from Microsoft causing WebException in Office Add-In

This is just a good samaritan FYI to Microsoft, not a question to the community. They have broken their VerificationServiceClient code with some server-side change that is causing VerificationServiceClient to throw an exception. I've fixed my…
Gabrielle
  • 11
  • 2
1
vote
2 answers

Getting promise undefined error when i use Promise in my word addin application

I'm developing a Word Add-in (Word API + Office.js),i am trying to implement a method as promise but i am getting error stating promise is undefined These are reference which i am using
1
vote
1 answer

Sideloading Word JS Addin developed on local Docker machine - Can't reach Add-in

I'm having trouble trying to side-load an add-in in MS Word, getting the error 'ADD-IN ERROR: A problem occured while trying to reach this add-in.' The add-in needs to be hosted on a local docker environment to be integrated in the rest of a web…
T. Altena
  • 752
  • 4
  • 15
1
vote
0 answers

Modifying Office document's properties like author using office.js for Office 2013 for Desktop

I'm working on an Microsoft office add-in using office.js, targeting Windows and Mac. One of it's requirement is to modify properties like author and tags. As per the documentation host (Excel, Word etc.) specific APIs have DocumentProperty class…
Prakhar Pal
  • 178
  • 7
1 2 3
99
100