office-js

How to implement OnEnter and OnExit event on ContentControl using Javascript API for Word 2016

痴心易碎 提交于 2021-02-19 02:21:41
问题 There are many contentcontrols in a document and I need to find out a way that the cursor is in which content control so that I will select that control and do the operation accordingly. I think by implementing onEnter and onExit events for contentcontrols , I can achieve it. But I don't know how to declare and invoke those eventhandlers in JavaScript api. Any help is really appreciated. 回答1: You would need to use a combination of APIs to implement that functionality with the current API set:

How to use REST to download Outlook attachments from a node server?

隐身守侯 提交于 2021-02-18 18:57:48
问题 Right now I use the ewsURL to fetch the attachments through a SOAP request. My Outlook Addin gets the ewsURL with a token and send it to the server and the server uses that to get the attachments. The problem is, this does not work for the mobile app. In mobile, I can't get the ewsURL. According to the docs, I have to use the REST API but it's not clear how to use it on the server side. Any help? 回答1: On the add-in side , there are a couple of differences when using Outlook REST APIs from an

Does the Office.js API support multiple range selection?

强颜欢笑 提交于 2021-02-17 06:58:06
问题 I need to select multiple ranges simultaneously via the Office.js API like you can do in the MSWord UI by holding down the CTRL key and highlight multiple non-contiguous paragraphs, like the screenshot below: This attempt doesn't work. Rather than highlighting the first two instances of the word "the" in the document, it's highlighting the first, then highlight the second afterwards: Word.run(function (context) { // Set up the search options. var options = Word.SearchOptions.newObject(context

Is it possible to refresh fields of a word document with Office.js?

橙三吉。 提交于 2021-02-11 06:11:25
问题 I have word documents with fields that display the value of custom document properties as such: `{ DOCPROPERTY example \* MERGEFORMAT }` Whenever my custom property is modified, in order for the changes to be displayed in my document, I need to select the field(s) and right-click -> update them. I was wondering if office.js had anything that would help me automatically update fields in my document. 回答1: There is no API to do this currently. But it is an excellent idea. Please suggest it at

Is it possible to refresh fields of a word document with Office.js?

百般思念 提交于 2021-02-11 06:09:48
问题 I have word documents with fields that display the value of custom document properties as such: `{ DOCPROPERTY example \* MERGEFORMAT }` Whenever my custom property is modified, in order for the changes to be displayed in my document, I need to select the field(s) and right-click -> update them. I was wondering if office.js had anything that would help me automatically update fields in my document. 回答1: There is no API to do this currently. But it is an excellent idea. Please suggest it at

Programmatically remove excel cell edit mode

荒凉一梦 提交于 2021-02-10 16:16:50
问题 we are working on creating an excel add-in using office-js API's. We have used delayForCellEdit property when we load data ( which will be called when data is changed in predefiined cell range ). When a user edits a cell and click outside the cell then the cell edit mode is exited but if the user clicks in the Add-in after editing a cell the cell edit mode is not exited. Is there a way to exit cell edit mode programmatically ? 回答1: Unfortunately, we do not support programmatically exit cell

Programmatically remove excel cell edit mode

℡╲_俬逩灬. 提交于 2021-02-10 16:15:10
问题 we are working on creating an excel add-in using office-js API's. We have used delayForCellEdit property when we load data ( which will be called when data is changed in predefiined cell range ). When a user edits a cell and click outside the cell then the cell edit mode is exited but if the user clicks in the Add-in after editing a cell the cell edit mode is not exited. Is there a way to exit cell edit mode programmatically ? 回答1: Unfortunately, we do not support programmatically exit cell

Inconsistent host behavior with Office JS insertHTML and paragraph formatting

淺唱寂寞╮ 提交于 2021-02-08 14:34:10
问题 I've noticed an inconsistency in office-js between Word 2016, Word for Mac and Word Online. When inserting a single <p> element with block/paragraph formatting, it seems that Word 2016 does not apply the paragraph formatting as defined in the style attribute of the <p> element. I can reproduce this both in the body of the document and in a Content Control. When I execute this snippet in an empty document on Word 2016 or Word for Mac: await Word.run(async (context) => { context.document.body

Outlook Add-in REST API In Shared Inbox Fails: ErrorInvalidMailboxItemId - Item Id doesn't belong to the current mailbox

末鹿安然 提交于 2021-02-08 10:12:48
问题 We have an Outlook (Office JS) Add-in with a manifest configured to support shared folders, i.e. <SupportsSharedFolders>true</SupportsSharedFolders> The add-in has been running flawlessly, for many months, on a number of machines that meet the minimum requirement set of 1.8 for shared folder support. Since 22-Apr-2020 it has returned the following error when selecting an email in a shared email inbox: Status Code: 404 ErrorInvalidMailboxItemId - Item Id doesn't belong to the current mailbox

Outlook Add-in REST API In Shared Inbox Fails: ErrorInvalidMailboxItemId - Item Id doesn't belong to the current mailbox

拈花ヽ惹草 提交于 2021-02-08 10:12:10
问题 We have an Outlook (Office JS) Add-in with a manifest configured to support shared folders, i.e. <SupportsSharedFolders>true</SupportsSharedFolders> The add-in has been running flawlessly, for many months, on a number of machines that meet the minimum requirement set of 1.8 for shared folder support. Since 22-Apr-2020 it has returned the following error when selecting an email in a shared email inbox: Status Code: 404 ErrorInvalidMailboxItemId - Item Id doesn't belong to the current mailbox