office-js

Office (JS) Outlook addin and Exchange token authentication

守給你的承諾、 提交于 2019-12-04 15:14:59
My Office add-in (which runs in Outlook) uses the OfficeJS library to get a callback token for authentication against Exchange: Office.context.mailbox.getCallbackTokenAsync(...); The token is sent to our server together with some message/attachment IDs and the server will attempt to connect to Exchange to retrieve said mail attachment. I use the EWS java API library for this. I am getting an Unauthorized 401 HTTP error back from Exchange when trying to bind to an EmailMessage: ExchangeService exchangeService = new ExchangeService(); exchangeService.getHttpHeaders().put("Authorization", "Bearer

Inserting OoXml into word throwing Error: Unknown

前提是你 提交于 2019-12-04 14:48:48
I've been attempting to insert OOXML into the body content of word documents via the office-js insertOoXML() method. I've even tried the simplest of implementations (thinking I was doing something incorrect when attempting to replace fieldCodes in the XML itself) and all result in this Error: unknown response after saying its "inserting": Error: unknown at new r (word-web-16.00.js:21) at i.c.processRequestExecutorResponseMessage (word-web-16.00.js:21) at word-web-16.00.js:21 To reproduce - here's a simple example of getting the body OoXML and attempting to replace it back in: Word.run(async

prevent task pane from closing during saving (async)

ε祈祈猫儿з 提交于 2019-12-04 11:53:40
We use the OfficeJs REST API for add-in development. To use this API, an accesstoken is needed, which we request by invoking Office.mailbox.getCallbackTokenAsync({ isRest: true }) during startup of our add-in. This does not fail for any code triggered by the onSend function: It seems OfficeJs saves the mail item before onSend code is triggered. However, this request apparently does fail when the mail item is not yet saved - which is the case for any new draft when it is just created - and thus breaks the init code of our add-in when the task pane is opened straight after composing a new

JavaScript API does not work for Excel 2013?

别等时光非礼了梦想. 提交于 2019-12-04 10:43:59
I just got a change recommendation report for one add-in I submitted. It says Your add-in is not working in the Excel 2013 client on Windows 7 with Internet Explorer 11. I have always been testing my add-in in Excel 2016 and Excel Online . So I just installed Excel 2013 (version 15.0.4841.1000 , which includes SP1 ), indeed the add-in does not work. But it seems that few things work... For example, the following example function writes haha in Cell A1 under Excel Online , whereas, it does not anything in Excel 2013 . function test () { Excel.run(function (ctx) { var range = ctx.workbook

JavaScript API does not work for Excel 2013?

情到浓时终转凉″ 提交于 2019-12-04 10:42:11
I just got a change recommendation report for one add-in I submitted. It says Your add-in is not working in the Excel 2013 client on Windows 7 with Internet Explorer 11. I have always been testing my add-in in Excel 2016 and Excel Online . So I just installed Excel 2013 (version 15.0.4841.1000 , which includes SP1 ), indeed the add-in does not work. But it seems that few things work... For example, the following example function writes haha in Cell A1 under Excel Online , whereas, it does not anything in Excel 2013 . function test () { Excel.run(function (ctx) { var range = ctx.workbook

How to find the Office AddIn Host it is a Word application or Excel using office.js?

Deadly 提交于 2019-12-04 06:52:31
I am creating a office AddIn which works in both excel and word applications and based on host if it is a word or excel host i want to execute different logic. I am using office.js to create office Addin. for example :- let say type="Excel" // after some logic executed if(type=="Excel") { //run code for excel applications } else { //run code for word applications } I have tried to use the bellow:- if (Office.context.requirements.isSetSupported('ExcelApi', '1.1')) { alert("yes it is excel"); } but it is not working when i run it in excel. I have sent the host in manifest file also <Hosts> <Host

Submit add-ins with custom functions

眉间皱痕 提交于 2019-12-04 05:31:50
问题 In this doc, it is mentioned that The following features aren't yet supported in the Developer Preview. ... ... Publishing add-ins to the Office Store or Office 365 centralized deployment that use custom functions. I just want to make sure it means that at the moment we cannot submit to Office Store any add-in that has custom functions; what we can do is only internally deploying add-ins with custom functions, right? 回答1: Your interpretation of that guidance in the documentation is correct. i

How can we force a mailbox item to be persisted to EWS?

这一生的挚爱 提交于 2019-12-03 21:50:21
Note: This particular issue has significant impact on our customers, which translates to high business impact with direct consequences on revenue. TL;DR. How can our Office add-in for Outlook, when a user interacts with our add-in while composing an email draft, minimize the amount of time it takes before the EWS GetItem API will return an OK response for the itemId we receive from Office.context.mailbox.item.saveAsync() ? If it turns out that our add-in has no control over when the item will be persisted to EWS, then what could an end-user do to speed this up ? We are looking for either (a) a

Excel JS Online Settings not persisting past session

心已入冬 提交于 2019-12-03 21:26:36
TL;DR: I'm having the same problem asked here: Excel JS API - SettingCollection not persisting Basically, I have an Excel add-in that is trying to save some information to document settings and retrieve it later. The whole thing works perfectly on the native Mac client, but does not work on Excel online. No errors, and the document setting appears to be there even after refreshing the Taskpane. But once the browser tab is refreshed, the document setting is no longer retrievable. Is this a known problem right now? there is a bug using the Excel-specific API. please use shared API in the

EWS request not responding with error on Mac

本小妞迷上赌 提交于 2019-12-03 21:12:46
In our Outlook add-in, we are using makeEwsRequestAsync to get the current email's MimeContent . We understand there is a 1MB request/response limit when using EWS via the JavaScript API. When we reach this limit on Windows, we at least see this message: "Response exceeds 1 MB size limit. Please modify your EWS request". However, when making this request for a large email (>1MB) on Mac (Outlook 2016), we don't get any sort of response whatsoever. The add-in just seems to hang. Is there any way we can catch this error on Mac? We would like to show a dialog or something notifying the user that