office-js

How to set the default browser in word addin

孤街醉人 提交于 2019-12-14 04:21:08
问题 Given that we have the below hyperlink in the word add in HTML page (e.g. Home.html): <a href="www.google.com" target="_blank">Go to google</a> Clicking on "Go to google" opens www.google.com using Internet Explorer outside the Word add-in. The problem is the default browser is set to Google Chrome and we wish to open all the external links using the default browser set by the user. How can we achieve this? 回答1: As Marc points out, it’s not possible today. That being said, there is an API

Evaluate a sub-formula of a formula

你离开我真会死。 提交于 2019-12-14 04:09:43
问题 After selecting a cell having a formula, we could select a part of its formula in Excel formula bar and calculate it (by pressing F9). I need to reproduce this evaluation of sub-formulas by JavaScript API. For example, let's assume the values of Cell A1 , B1 , C1 are respectively 1 , 2 , 3 , and Cell D1 contains a formula =A1+B1+C1 . I would like to be able to evaluate quickly a sub-formula such as A1+B1 , B1+C1 , and get the result 3 and 5 . In VBA, under manual calculation mode, we could

How to get the body of https response

自古美人都是妖i 提交于 2019-12-14 03:13:47
问题 I am doing programming in Office.js . I'm trying to read the data which I get from the server. Https.get return the dada for sure! (I print it one second before sending it back from the server and also get a 200 code). The issue is that I am not able to take the data I got from server and print it or o some calculations with it. I looked for an answer everywhere but it just doesn't work for some reason I don't get. var request = https.get("https://localhost:8888/getLastDetailedOrders",

Is it possible to set a word documents custom properties?

左心房为你撑大大i 提交于 2019-12-13 21:28:32
问题 So basically i want to add some custom properties to a word document. Is this possible yet from the word api 1.3? I found something along the lines of: context.document.workbook.properties but that only seems to work for excel. Thanks! 回答1: To add more detail to the previous answer: Yes Word.js 1.3 introduces creation and retrieval of custom and built-in document properties. The API is still in preview, you need to at least have the December fork build for this feature to work. Make sure you

Make an add-in available in Excel 2016 for Windows

偶尔善良 提交于 2019-12-13 17:25:00
问题 Following this thread, I have modified the manifest file of my two add-ins, and resubmitted to the store. Yesterday, I got a mail to say one is approved, and today I got another mail to say the other one is approved as well. However, I could not find them in Excel 2016 for Windows . Then I go to the web page of the Office Store. I could find the two add-ins, but I see in their page: This add-in requires one of the following applications: Excel 2016 for Mac , that's it, it does NOT mention

Setting width of Office add-in task pane

白昼怎懂夜的黑 提交于 2019-12-13 17:16:25
问题 Is it possible to set the width of a Outlook add-in when it gets loaded up. Right now when I click on my addin button on the ribbon, the task pane shows up on the right with a width of about 437 pixels. I would like to increase that width to something like 820 pixels. 回答1: The task pane add-in doesn't support to set the width for the panel. You can submit the feedback here if you want the task pane add-in to support this feature. 回答2: That's right, there is no way to specify the width.

Conflict of displayDialogAsync and html5-history-api

ぐ巨炮叔叔 提交于 2019-12-13 17:11:36
问题 I have an application by mean-stack that hosts a website and an Excel add-in. html5 is enabled, and it has <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script> <script src="https://cdn.rawgit.com/devote/HTML5-History-API/master/history.js"></script> In the Excel add-in, I have a button that opens a page in the website by Dialog API: $scope.openDialog = function () { Office.context.ui.displayDialogAsync("https://localhost:3000/preview/tmp/6wr-4PqdBrYQwjp3AAAD", {}

Using Paragraph outside the Word.run flow

こ雲淡風輕ζ 提交于 2019-12-13 15:25:12
问题 I am trying to first find a paragraph, and later on when a user clicks a button, do some manipulation on the paragraph. I tried using a sample from what seems to be the defenitive book: "Building Office Addins" by Michael Zlatkovsky. var global_paragraph = undefined; async function analyzeDocument() { Word.run(async function(context) { const paragraphs = context.document.body.paragraphs; context.load(paragraphs, 'text'); return context.sync().then(() => { for (let i = 0; i < paragraphs.items

Call to getUserIdentityTokenAsync() returning a null token

跟風遠走 提交于 2019-12-13 12:22:44
问题 We have an add-in in production where, for certain users, the call to getUserIdentityTokenAsync() fails and returns a null token. The response is "Status" = "failed", "Error" = {message: "An internal error has occurred", name: "Internal Error"} Would anyone know what could cause this type of failure? Certain users always get the error, and we have never seen the error locally or during development. It seems to happen only for desktop Outlook users. We have not seen any errors for users when

Send a message from host page to Dialog box

那年仲夏 提交于 2019-12-13 07:27:49
问题 I am trying to use Dialog API of Office Add-ins. According to the doc, we could use Office.context.ui.messageParent to send a message from the Dialog box to the host page (eg, task pane). Whereas, I don't see how we could send a message from the host page to the Dialog box. Does anyone know how to do this? 回答1: There are 2 possible solutions: Send data as query params, when you open a pagein dialog box. If there are in same domain then localstorage should be available in dialog which was