office-js

Find table intersect with selection

流过昼夜 提交于 2019-11-27 08:30:40
问题 I'm looking for a Javascript equivalent of the Excel VBA Intersect method. I need to find the active cell table. Basically everything I do with tables is based on which table the user currently has selected. IIRC, there is currently there is no way to do this directly. So what I'm trying to do is basically this: Get the selected range (still not perfect, as I really only want the ActiveCell , not the Selection ). Get the worksheet. Loop through all tables on the worksheet. Check each table

Adding office.js disables html5mode

陌路散爱 提交于 2019-11-27 04:53:41
问题 I have a mean-stack website which enables html5mode by $locationProvider.html5Mode(true) . and index.html looks like as follows: <html> <head> <base href="/" /> ... </head> <body ng-app="f"> <ui-view ng-cloak></ui-view> </body> </html> Because of html5mode , we can load in a browser, eg. https://localhost:3000/home , which will remain the same; without html5mode , that url would become https://localhost:3000/#/home . Now I want the server to serve (besides the web site) also an Office add-in.

How can a range be used across different Word.run contexts?

家住魔仙堡 提交于 2019-11-27 03:39:53
问题 I have created a taskpane addin for word that runs a search and displays information about the results as a list to the user. When the user clicks on an item in the list I want to select the range in word to show the user the location of the item. The addin will then allow the user to perform additional tasks on the range, for example change the font colour. I am able to run the search and get ranges for display using the function below: function runSearch(textToFind) { var items = []; return

Why Outlook's RoamingSettings object initialized with old values after page re-load/ redirect?

北战南征 提交于 2019-11-27 03:38:15
问题 Precondition: Simple Outlook add-in with one (reload case) or two HTML pages (redirect case). Office.initialize called before any objects access Use RoamingSettings object as per documentation: How to save settings in the user's mailbox for Outlook add-ins as roaming settings Coding: // The Office initialize function must be run each time a new page is loaded Office.initialize = function (reason) { $(document).ready(function () { app.initialize(); var settings = Office.context.roamingSettings

In Excel Online, OfficeJS API is not passing the host_Info_ parameter anymore to Excel Add-In

一世执手 提交于 2019-11-26 23:31:45
问题 I don't know when this started happening or if things have changed but the _host_Info param is not being passed by the framework to my Excel Add-In in Excel Online. It passes an empty "et=" parameter which is OK in this case since I'm in dev mode. The Excel desktop client is still passing it. This is required by my add-ins to switch functionality between Excel Online and Excel for Windows. I've checked the docs and can't find that anything has changed. 回答1: To append to Sudhi's answer: with

Office.js nullifies browser history functions breaking history usage

不问归期 提交于 2019-11-26 23:14:03
问题 The official version of office.js available here: https://appsforoffice.microsoft.com/lib/1/hosted/office.js It contains the following lines in code: window.history.replaceState = null; window.history.pushState = null; This breaks some of the history functionality in my Excel Add-ins (I'm using react and react-router ) Why is office.js nullifying those history functions? I cannot find any explanation in the documentation. 回答1: The browser control used in Excel does not support History API, if

Neat ways to get environment (i.e. Office version)

北战南征 提交于 2019-11-26 16:42:21
Unfortunately, some features of the office API do not behave exactly the same in all environments (example: formatting in Excel Online and Excel 2013). Additionally, some nice new features are not available in Excel 2013 but are available in Excel 2016 (Excel.js) Of course, I could tell users they can only use my app with 2016, and simply not implement things that aren't fully supported in all environments. I would prefer offering my app to users of Excel 2013 even if they don't have a way (or the inclination) to upgrade to 2016. And I would rather gracefully downgrade my feature list in less

Neat ways to get environment (i.e. Office version)

梦想与她 提交于 2019-11-26 04:54:36
问题 Unfortunately, some features of the office API do not behave exactly the same in all environments (example: formatting in Excel Online and Excel 2013). Additionally, some nice new features are not available in Excel 2013 but are available in Excel 2016 (Excel.js) Of course, I could tell users they can only use my app with 2016, and simply not implement things that aren\'t fully supported in all environments. I would prefer offering my app to users of Excel 2013 even if they don\'t have a way