office-js

Office.js Excel: Improve performance when writing rows with formatting

拜拜、爱过 提交于 2019-12-01 06:50:20
问题 I can write 25000 rows x 3 columns of plain text in under .3 seconds which is fantastic. However, as soon as I add more than plain text (formatting, formulas, cell coloring, conditional formatting, columnWidth adjustments, etc) it takes dramatically longer to finish. For example, I wrote the same 25000 rows (x 1 column) with range.getCell(i, 0).format.fill.color = 'yellow' and it took 31.223 seconds, even using suspendApiCalculationUntilNextSync() . What can I do to get better write

Send POST AJAX request from Office Add-In

馋奶兔 提交于 2019-12-01 06:13:48
I'm trying to send POST Ajax request for third party service from my Outlook Add-in, but no matter what I tried I receiving Error: Access is denied , and status 0 (request never hit the server). Assuming we are running IE9 or 8 behind the outlook I tried old school hacks like https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest . $.ajax({ url: endpoint, data: JSON.stringify({'1':'2'}), // headers: {'X-Requested-With': 'XMLHttpRequest'}, contentType: 'text/plain', type: 'POST', dataType: 'json', error: function(xhr, status, error) { // error } }).done(function(data) { // done });

Set CustomProperties on appointment for all attendees

此生再无相见时 提交于 2019-12-01 04:20:28
tl;dr When setting CustomProperties to an appointment that has attendees, only the appointment for the organizer gets the CustomProperties . The properties do not propagate to the appointments of the other attendees. Longer version When we create an appointment with multiple attendees and then log in as each attendee, we notice that each ItemId is different. So, it appears that each attendee in a meeting gets their own copy of an appointment. (Would really like someone to confirm this is true). However, when setting a custom property from our add-in (using the Outlook JavaScript API), only the

Do Office Add-ins always require Internet access to work?

非 Y 不嫁゛ 提交于 2019-12-01 02:59:21
问题 Let's take Excel for example. In Excel 2016, when I select an add-in in the STORE , after clicking on Trust It , will the code ( .html , .js files) of the add-in be downloaded or installed on my machine? In other words, have the add-ins under MY ADD-INS been already installed on my machine, such that i could load and run them without Internet (if an add-in does not send or receive special data to or from Internet)? I am asking this question, because i want to know if a basic add-in always

Set CustomProperties on appointment for all attendees

浪子不回头ぞ 提交于 2019-12-01 01:45:18
问题 tl;dr When setting CustomProperties to an appointment that has attendees, only the appointment for the organizer gets the CustomProperties . The properties do not propagate to the appointments of the other attendees. Longer version When we create an appointment with multiple attendees and then log in as each attendee, we notice that each ItemId is different. So, it appears that each attendee in a meeting gets their own copy of an appointment. (Would really like someone to confirm this is true

Office add-in with both taskpane and content?

随声附和 提交于 2019-12-01 01:14:46
I spent all night looking this up and can't find it. Is it possible to have an Excel/Office add-in that has both content and taskpane components? Really, I want a content app, but I want extra options/buttons in the ribbon and taskpane that will trigger different actions/changes in my content app. Whenever I try to add the VersionOverrides xml node to my manifest on a content app, it always fails. None of my buttons show up. All the examples I can find that work have the namespace [...]/taskpaneappversionoverrides . I've tried changing it to [...]/contentappversionoverrides but that doesn't

Office Web Add-ins - Internal error when saving settings

岁酱吖の 提交于 2019-12-01 01:08:42
I'm getting an failure when trying to save my document settings. The message is the following: {"name":"Internal Error","message":"An internal error has occurred.","code":5001} My code: Office.context.document.settings.set('token', token); Office.context.document.settings.set('email', email); Office.context.document.settings.saveAsync(function (asyncResult) { if (asyncResult.error) { displayError(asyncResult.error.message); } }); The problem revealed when I reinstalled my OS (Windows 10) and does not exist in Office for Mac and Web. It happens both on PowerPoint and Word. Maybe it's something

How to enable On-Send Feature for New Outlook Web App

懵懂的女人 提交于 2019-12-01 00:28:48
Does the New OWA support on send? I have an addin that uses the on-send feature, it works fine in the old OWA but not the new OWA, do i have to do some extra configurations in order to get on-send to work in new OWA? onSend feature is currently not available on new OWA. We are currently working on it and should be available in the near future (no tentative date available). 来源: https://stackoverflow.com/questions/55510506/how-to-enable-on-send-feature-for-new-outlook-web-app

Check if Office.js is loaded outside of Office client

♀尐吖头ヾ 提交于 2019-11-30 20:43:58
If we load a webpage referencing office.js outside Office client, we will get a warning: Office.js is loaded outside of Office client . This information is useful. Does anyone know if there is an API to check that inside my code? Edit 1: I explain a little bit my scenario and why I ask this question. I am making an application with angularjs which can be loaded in a browser as a web page or in Office as an add-in. And I realise that we should not do <body ng-app="myApp"> and angular.bootstrap(document, ['myApp']) together, otherwise controllers will execute twice . So I decided to not write

No stack trace info when error happens in Office JS API

若如初见. 提交于 2019-11-30 20:33:30
We're getting lots of Office JS API errors in Application Insights, but they don't have a stack trace. All that we have - The browser's same-origin policy prevents us from getting the details of this exception. Consider using 'crossorigin' attribute. . Note, we have set 'crossorigin' attribute to office.js in Add-In HTML: <script src="//appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript" crossorigin="anonymous"></script> The issue is following: office.js injects additional scripts depending on environment and these scripts don't have crossorigin set. For example https: