office-js

Issue with Office.context.document.settings.get

老子叫甜甜 提交于 2019-12-01 13:08:56
问题 I'm reading settings from a Word Document using: function callbackFunction(){ var varValue = Office.context.document.settings.get("VariableName"); } This call is made right after a call to : Office.context.document.settings.refreshAsync(callbackFunction); The settings are stored in a valid JSON String WebExtensionProperty: I can see the setting object in the Open XML productivity tool, without problem We.WebExtensionProperty prop = new We.WebExtensionProperty(){ Name = "VariableName", Value =

Outlook Add-in not opening the default browser when clicking on link inside the addin

 ̄綄美尐妖づ 提交于 2019-12-01 12:51:35
Background We are having users complain about links ( <a href="..."> ) from our Outlook addin not opening in their default browser. Some see that Google Chrome (default) is opening, which is the intended behavior. But some see that IE is opening regardless of what the default browser is. I suspect this may have something to do with the version of Outlook - but I haven't been able to pinpoint how and what. Maybe it has got something to do with the IE version on the computer since the addin window should be running in IE. Perhaps even the version of Windows. The users that have seen the issue so

How to specify exact version of Office.js used?

纵然是瞬间 提交于 2019-12-01 11:44:41
问题 We're running an Outlook add-in and it looks like Microsoft have updated the version of Office.js from 16.00 to 16.01 : outlook:{ios:"16.00",mac:"16.00",web:"16.01",win32:"16.02"} (via https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js) One of the changes looks to be additional verification to the abstraction of postMessage ensuring that the domain (including subdomain) of the child / parent are the same. Because we host our add-in and central auth server on different subdomains and

Outlook Add-in not opening the default browser when clicking on link inside the addin

南楼画角 提交于 2019-12-01 11:21:49
问题 Background We are having users complain about links ( <a href="..."> ) from our Outlook addin not opening in their default browser. Some see that Google Chrome (default) is opening, which is the intended behavior. But some see that IE is opening regardless of what the default browser is. I suspect this may have something to do with the version of Outlook - but I haven't been able to pinpoint how and what. Maybe it has got something to do with the IE version on the computer since the addin

How do we add field code for Word using word javascript api

大城市里の小女人 提交于 2019-12-01 11:13:33
I want to add field code using word JavaScript API. I checked the API documentation but I found nothing regarding this. Is there a way to do it in this API? There is no direct support in the API for adding fields, i.e. you will have to create Open XML containing the field. You can then insert this Open XML in your document (something a long the lines of the following untested snippet): // Run a batch operation against the Word object model. Word.run(function (context) { // Queue a command to get the current selection and then // create a proxy range object with the results. var range = context

StorageEvent does not work in Excel for Windows

别等时光非礼了梦想. 提交于 2019-12-01 10:49:10
问题 As some existing threads suggest (eg, one, two, three), current Dialog Box does not provide an API to send regularly messages from the host page (eg, task pane) to the Dialog box. So I have to look for a workaround: we reserve a variable message in localStorage , then we make the Dialog box check regularly if the value of message changes. It is like manually implementing an event listener by localStorage . Does anyone know how to implement that in a sure and efficient way (given JavaScript

In an Outlook addin, how to check whether we are in compose mode or read mode?

為{幸葍}努か 提交于 2019-12-01 10:30:28
I'm creating an outlook add-in and use the OfficeJS API in React app. In there I want to load a specific set of features for the compose mode and another set of features for the read mode. So my question is, how to see in which mode I'm currently on? In the manifest.xml file you should have different ExtensionPoint for compose and read view as follow ... <ExtensionPoint xsi:type="MessageReadCommandSurface"> </ExtensionPoint> <ExtensionPoint xsi:type="MessageComposeCommandSurface"> </ExtensionPoint> Each of this sections have to have Action tag with ExecuteFunction or ShowTaskpane type. If you

Unable to edit worksheet in an Excel add-in (Office js) after closing a Dialog

家住魔仙堡 提交于 2019-12-01 10:29:46
问题 In an Excel add-in, right after closing a dialog created using displayDialogAsync, you cannot edit the cells in the worksheet. If you click anywhere else outside the worksheet (ribbon, task pane, etc), minimize/maximize Excel, or double click a cell, then you can edit again. If you scroll while you cannot edit, everything in excel becomes "un-clickable". Also, I have noticed that the title bar (where the name of document is shown) remains grayed out until you click outside the worksheet as if

Office.js Word Add-In: Performance Issue with Updating Values in Large Tables

泪湿孤枕 提交于 2019-12-01 10:26:47
问题 Summary: Updating values in large Word tables (larger than 10 by 10) is very slow. Performance gets exponentially worse with table size. I'm using myTable.values = arrNewValues . I've also tried myTable.addRows("end", rows, arrNewValues) . Where arrNewValues is a 2D array. I've also tried using updating via getOoxml() and insertOoxml(), but ran into other issues I haven't been able to resolve, but has good performance. Slow performance seems to be caused by "ScreenUpdating" (same issue exists

In an Outlook addin, how to check whether we are in compose mode or read mode?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 09:30:29
问题 I'm creating an outlook add-in and use the OfficeJS API in React app. In there I want to load a specific set of features for the compose mode and another set of features for the read mode. So my question is, how to see in which mode I'm currently on? 回答1: In the manifest.xml file you should have different ExtensionPoint for compose and read view as follow ... <ExtensionPoint xsi:type="MessageReadCommandSurface"> </ExtensionPoint> <ExtensionPoint xsi:type="MessageComposeCommandSurface"> <