office-js

Cannot edit CodeMirror or Ace in a taskpane of an add-in in Excel for Windows

梦想与她 提交于 2019-12-10 23:59:30
问题 I just realized that we cannot modify texts in CodeMirror or Ace in a taskpane of an add-in in Excel for Windows. I have made a test html page with this code, and link it to a manifest file of an Excel add-in. It works well in Excel Online (in Chrome and IE), Excel for Mac. However, in Excel for Windows, 1) textarea works well; 2) We could put the focus on CodeMirror, whereas we can NOT type anything; 3) When we put the focus on Excel then back on Ace, we can NOT type anything. I have not

Why worksheet Id changing after reopening document (Excel javascript API )?

风格不统一 提交于 2019-12-10 23:45:23
问题 In my Excel tab-pane addin after adding worksheet(manually/programmatically) and running code below I have worksheet object where id is "{040E0F18-0F61-4CD9-886D-95112C925793}", then I save workbook, close and open again, run code below and it shows me that the worksheet.id now is "{00000000-0001-0000-0000-000000000000}"! In office.js reference about worksheet id: The value of the identifier remains the same even when the worksheet is renamed or moved. Read-only. Excel.run(function (ctx) {

Dialog with TinyMCE causes error 12003

六眼飞鱼酱① 提交于 2019-12-10 23:45:09
问题 With the newest update to Word (1611) dialogs with TinyMCE causes error 12003: Invalid URL Syntax. According to Use the Dialog API the cause is The dialog box was directed to a URL with the HTTP protocol. HTTPS is required. Simple example is to put below code in a dialog (oddly enough it works in a panel). Updated code <!DOCTYPE html> <html> <head> <title>Office.js with TinyMCE</title> <meta charset="utf-8" /> <script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type=

How to maximise performance for table row addition of 50K+ rows using Excel JavaScript API office Add-IN

时光毁灭记忆、已成空白 提交于 2019-12-10 23:17:55
问题 I m trying to add large number of rows to table. My Project has requirement for large table addition. Please let me know if there is a better alternative to maximize performance. Should I use Range object API? The code is as shown below. function createSampleSheet(numberOfTimes) { startTime = performance.now(); Excel.run(function (context) { var sheets = context.workbook.worksheets; var sheet = context.workbook.worksheets.getActiveWorksheet(); var expensesTable = sheet.tables.add("A1:H1",

Cannot switch between popup window and Excel for Mac

喜夏-厌秋 提交于 2019-12-10 21:25:49
问题 I have made an Excel add-in, which pops up a window either by window.open or Dialog API. I just tested it in Excel for Mac: when the window is opened, it seems that we can NOT put the focus back to Excel or the add-in taskpane; we have to close the window before choosing Excel or the add-in taskpane. Does anyone know if there is a way to enable switching focus between popup window and Excel? 回答1: The dialog window is a modal in nature that forces the user to interact with it before they can

How to name and reference an Excel range using office.js

只愿长相守 提交于 2019-12-10 20:12:20
问题 I'm developing an Excel add-in using office.js library, and need to create some named ranges to track and access later. However according to the API documentation: NamedItemCollection: https://github.com/OfficeDev/office-js-docs/blob/master/reference/excel/nameditemcollection.md NamedItem: https://github.com/OfficeDev/office-js-docs/blob/master/reference/excel/nameditem.md There is no method for creating named items. Is there a way to name and reference an Excel range using office.js? Thanks.

Get OneDrive Item Id for Current Word doc

我们两清 提交于 2019-12-10 18:49:25
问题 I'm looking into building an add-in for Microsoft Word that would involve creating a copy of the current document. I've found where I can copy an item through the OneDrive API. However, this requires the item-id for the document to be copied. I can't seem to find how to get the item-id for the current Word document through the Office JavaScript API. I've looked on the Office.context.document object, as well as the Office.context.document.getFileAsync() and Office.context.document

Word Add-in - How to read custom document property

六眼飞鱼酱① 提交于 2019-12-10 18:15:20
问题 I am developing a Word plugin using the Office JS API. Currently I can add custom properties to the Word document by doing: context.document.properties.load(); context.document.properties.customProperties.add("file-name-prop", "my file name"); If I then download the file I can see the property in the "custom.xml" file inside the zipped docx. But I am not able to read the property back. I am trying to do it like this: context.document.properties.load(); var filenameProp = context.document

Authenticating using OfficeDev/office-js-helpers rather than adal

心已入冬 提交于 2019-12-10 17:55:01
问题 I'm working on an Office Add-in that currently uses adal to obtain an auth token. As I want to use the Fabric front end I am changing it to React and I notice that the officer-js-helpers have implemented authenticators that seem to do the same job as the adal library. Am I correct in this assumption? If so, how do I duplicate this adal config using the office-js-helpers authentication functions: var adalConfig = { instance: 'https://login.microsoftonline.com/', tenant: 'myprivatesite

How to copy range formatting in office.js?

穿精又带淫゛_ 提交于 2019-12-10 17:01:31
问题 Tried the following code that I pieced together from various sources but it doesn't seem to be working. Do I need to go through each individual property and assign them one by one? Excel.run(function (ctx) { var worksheet = ctx.workbook.worksheets.getItem(worksheetName); var range = worksheet.getUsedRange(); range.load(["formulasLocal", "address", "format/*", "format/fill", "format/borders", "format/font"]); var newWorksheet = ctx.workbook.worksheets.add(worksheetName + " -Copy"); return ctx