office-js

How can Office Add-in (Task-pane) not display by default

眉间皱痕 提交于 2019-12-02 05:33:56
I have an Task-pane Office Add-in ( https://msdn.microsoft.com/en-us/library/office/fp123523.aspx ) on registered Office 365 Site. When the user opens a spreadsheet from a document library on that site, then in edit mode, can use the "Office Add-ins" from the Insert menu to insert my add-in to the Spreadsheet. My add-in helps them population and update data on the spreadsheet. They then save the spreadsheet back with the updated data. Now, the next time they open that spreadsheet, my task-pane shows up again. Is there any the task pane can not start opened? I would like the user to explicitly

How to identify the Excel Sheet changed event in office js api?

本小妞迷上赌 提交于 2019-12-02 04:40:07
We have an Excel office js add-in written on angular. It has different functionalities based on the sheet the user is in. When users switch the sheets of excel, how can the application know it, so it can change the UI to match the sheet's functionalities? There isn't a sheet-changed event. However, one workaround would be to subscribe to DocumentSelectionChanged events, then check the user's active sheet each time to see if it changed. UPDATE May 18 2017: With ExcelApi 1.2+, you can use a new syntax The new syntax is as follows: context.workbook.onSelectionChanged.add(yourHandler) ; You can

Cannot load local office.js

限于喜欢 提交于 2019-12-02 04:04:17
As this answer suggested, I want to modify a little bit office.js . So I copied the content of https://appsforoffice.microsoft.com/lib/1/hosted/office.js to local, such that https://localhost:3000/static/office.js shows well the content. Then, I make a very simple file test.html : <html> <head> <!--<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>--> <script type="text/javascript" src="https://localhost:3000/static/office.js"></script> </head> <body> haha </body> </html> Loading https://localhost:3000/static/test.html with remote office.js in a browser shows

Trusted way to get the host origin of an Office add-in

扶醉桌前 提交于 2019-12-02 02:56:17
I'm currently implementing an Outlook Add-in. It shows the user a pop-up window whenever the user is about to complete a potentially dangerous action, to protect against clickjacking attacks . I was hoping not to have to show the user the pop-up window every time they use the add-in -- only the first time they use it from a new host origin. Is there a way to get the verified host origin of an Office add-in, so I can remember that the user trusts it for next time? Right now I'm listening for the postMessage s from the host (e.g. https://outlook.office.com ) to the Office.js SDK and looking at

How to lock only dedicated cells via Excel JavaScript API

这一生的挚爱 提交于 2019-12-02 02:40:18
问题 As documented here I tried to lock only some cells (all cells of a column in my case) but all cells of the whole document are locked and not only the cells of the range. I already tried to lock only some cells like "D1:D5" but again all cells are locked and not only these 5 cells. This is my code: function lockColumnHandler() { lockColumn("Sheet1", "D:D"); } function lockColumn(sheetName, columnRange) { Excel.run(function (ctx) { var sheet = ctx.workbook.worksheets.getItem(sheetName); var

Outlook WebAddin throwing internal server error when registering Office.EventType.ItemChanged

孤街醉人 提交于 2019-12-02 02:25:39
问题 In my outlook WebAddin, i am trying to register for mail ItemChange event using below code. Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, mailItemSelectionChanged, [], function (result) { if(result && result.status != 'succeeded'){ console.error('result => ' + result); } }); Whenever user changes mail in pinned mode, i receive mail change event for first time. then if there is change in conversation, i am reloading the plugin with location.reload() to clear the cache

Office Web App - Show task pane on load

亡梦爱人 提交于 2019-12-02 01:49:50
How do I show a custom taskpane automatically when the add-in loads (i.e. without having to click a command that is tied to that URL)? Jan 2018 update: Office has shipped a new feature which lets you configure your add-in to automatically open a task pane when the file loads if the add-in had been used there previously: https://docs.microsoft.com/en-us/office/dev/add-ins/design/automatically-open-a-task-pane-with-a-document . Original Answer: Commands cannot currently be used to launch a task pane when the document opens. However, you can cause the task pane to open automatically if you remove

Word add-in stops working after dialog.close is fired. Office JS

╄→尐↘猪︶ㄣ 提交于 2019-12-02 00:52:06
问题 I have been working on an Office365 application where I opened a dialog and after some kind of activity when I close the dialog with dialog.close(). It works perfectly fine but ribbon button stops working and next time it will not show that same dialog again. Office.context.ui.displayDialogAsync("https://" + location.host + "/Dialog.html", { width: 90, height: 90, requireHTTPS: true }, function (asyncResult) { dialog = asyncResult.value; dialog.addEventHandler(Office.EventType

How to lock only dedicated cells via Excel JavaScript API

六月ゝ 毕业季﹏ 提交于 2019-12-01 23:28:27
As documented here I tried to lock only some cells (all cells of a column in my case) but all cells of the whole document are locked and not only the cells of the range. I already tried to lock only some cells like "D1:D5" but again all cells are locked and not only these 5 cells. This is my code: function lockColumnHandler() { lockColumn("Sheet1", "D:D"); } function lockColumn(sheetName, columnRange) { Excel.run(function (ctx) { var sheet = ctx.workbook.worksheets.getItem(sheetName); var range = sheet.getRange(columnRange); if (range) { range.format.protection.locked = true; } sheet

Overlay item for all slides in PowerPoint

不羁的心 提交于 2019-12-01 22:08:36
问题 I want to make a PowerPoint add-in to show some small html+css component on each slide, and not by adding add-in every time I'm adding a new slide. What should I look for and could it be done with some office add-ins and commands APIs? 回答1: In PowerPoint, the way to add content that's repeated on every slide is called Slide Master (View > Slide Master). Unfortunately, content add-ins in the Slide Master view show only the static image of the add-in, not live HTML+CSS. So there's no way to put