office-js

Can we load Excel file in Office.js Add-in

有些话、适合烂在心里 提交于 2019-11-29 16:54:09
I am trying to load a Excel file in Excel online. By loading a file I mean lets say I receive an Excel file from a service which I need to show on the current workbook. The file location can be a url or any folder in my site. Excel.run(function (context) { var workbook = context.workbook; //workbook.load or something ? } Add-ins are scoped to the document and are intended to extend the functionality of the Office application, not as a mechanism for opening documents themselves. What you're describing is what WOPI is intended for. The WOPI protocol provides an interface between Office and the

Get slide index or visibility state of PowerPoint content addin (Office.js)

老子叫甜甜 提交于 2019-11-29 16:02:10
I'm writing a PowerPoint content addin using Office.js API. I need a way for each instance of that addin to determine the index of the containing slide, or, if this is impossible, the visibility state of the addin (i.e. whether the containing slide is currently visible on screen). The documentation suggests no API specifically intended for this purpose, so I've been using the following method: Upon addin initialization (inside Document.initialize callback), request currently selected slide using Document.getSelectedDataAsync method. Since addin cannot be initialized until it is visible, we can

How to detect if Office 365 addin is already active from a VSTO Outlook addin or vice-versa?

北城余情 提交于 2019-11-29 12:37:40
I am no programmer in this field. We had an addin built on VSTO framework, which works for all Windows Outlook applications. Recently, we built O365 addin and it solves our problem of distribution to Mac. However, the existing Windows Outlook users see two different addins. Is there a way to detect if Outlook windows addin already installed through O365 addin or vice-versa? Unfortunately, there is no functionality to detect COM/VSTO add-on installation or enumerate installed add-ons from Office.js API. If you have strong business case, you may post request at https://officespdev.uservoice.com/

Office.js web WORD add-in: window.open() method is not working with “about:blank” URL

一世执手 提交于 2019-11-29 12:33:55
Summary : window.Open('') or window.Open('about:blank') works with JavaScript in a normal html file as can be tested here . But it does not seem to work in an Office.js add-in. Details : On my Windows 10 desktop with VS2017 I created this Office.js WORD add-in project that works perfectly with my Microsoft Office Home and Student 2016 edition. In the same project, I then created a new button btnTest in the home.js file. When I click btnTest it successfully calls the following MyTest method and opens a new window with window.Open('some URL') . But in the same MyTest method when I call window

Open an html page in a default browser from an add-in

一笑奈何 提交于 2019-11-29 07:50:45
I would like to insert a hyperlink to the task pane of my add-in, and I want this link to open support.html page in a default browser. <a href="https://example.com/support.html" target="_blank">Support</a> However, the above code opens support.html page inside the task pane. Users may not know how to go back to the main page of the add-in. Does anyone know how to open the page in a default browser of users? (By the way, is it recommended to launch something outside the add-in? If not, what's the common UX design for the help page?) You can open a new browser window from an Office Add-in via

Find table intersect with selection

a 夏天 提交于 2019-11-28 14:28:15
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 and see if the selected range is in the table range. I've monkey'd around a bit, and this is what I

Access to Outlook RestAPI from an Outlook web Add-in

时光总嘲笑我的痴心妄想 提交于 2019-11-28 13:45:23
I developed an Outlook Web Add-in that is working fine. It's a Taskpane that is available in compose mode of appointments and that collects event's data, adds a few ones and send that all to an API somewhere. What I would like to do now is to subscribe the authenticated user to the Outlook Rest API in order to get notified when the event is deleted. The subscription call should look like this one: POST https://outlook.office.com/api/v2.0/me/subscriptions HTTP/1.1 Content-Type: application/json { @odata.type:"#Microsoft.OutlookServices.PushSubscription", Resource: "https://outlook.office.com

Unable to POST <Form> from Excel 2016 for Mac or Excel for iPad [duplicate]

霸气de小男生 提交于 2019-11-28 11:21:57
问题 This question already has answers here : Why doesn’t the form not POST in Excel 2016 for Mac? (2 answers) Closed last year . When testing an Excel Web Add-in that has an HTML form that POSTs to httpbin Request & Response Service, the form is not being sent. I am using Excel 2016 for Mac version is 15.39 (171010) running on High Sierra ver 10.13.1. I have seen the same issue with Excel for iPad. Are Excel Add-ins incompatible with Excel 2016 for Mac and iPad when using POST method for forms?

Keep Office add-in task pane open at document load

耗尽温柔 提交于 2019-11-28 11:20:18
问题 I have a task pane (desktop) Office add-in built with the latest VS 2015 template for Excel and Word add-ins. When I open the file, the add-in task pane is not visible. My users need to click a button on the toolbar to open it, which they complain about. In addition, I save the document with the task pane expanded but it does not affect that behavior. I remember a previous version of the add-in manifest (when it was called app for Office) kept the pane open but I upgraded it so I can use

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

冷暖自知 提交于 2019-11-28 10:31:50
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 Word.run(function(context) { var options = Word.SearchOptions.newObject(context); options