office-js

How to tell when to use EWS vs rest API in Outlook Add-in

痞子三分冷 提交于 2019-12-22 18:20:13
问题 Is it possible to tell either in the XML file or through OfficeJs if the add-in can use the REST API or if it needs to use the older EWS API? We have an Outlook add-in that needs to support OWA/O365 and Outlook 2016 with a stand alone exchange server. We are wondering if it is possible through the manifest XML file or through OfficeJs to detect the configuration of users account so we can properly access their content with the correct API. The only alternative I can see is to provide two

Enable Outlook Web Add-in only on the Web

瘦欲@ 提交于 2019-12-22 14:00:10
问题 I developed an Outlook web-based add-in. To install it, I added the manifest file from the "Manage add-ins" page in OWA: https://msdn.microsoft.com/en-us/library/office/fp142256.aspx. The add-in is showing up in both Outlook Web App and Windows Desktop App. Is there a setting or code change need to be done to make the add-in available only in the Web App. 回答1: We have no such capability - we'd like the platform to provide users with consistent experience regardless of Outlook client/platform

Insert table inside content control with Office.js

老子叫甜甜 提交于 2019-12-22 11:43:21
问题 i'm trying to insert a table inside the content control. Here is my code: function insertTable() { Word.run(function (context) { var range = context.document.getSelection(); var cc = range.insertContentControl(); cc.title = "My Table"; var values = [["Apple", "red", "round"], ["Banana", "yellow", "long"], ["Pear", "green", "oblong"]]; context.load(cc); return context.sync().then(function () { var table = cc.insertTable(3, 3, 'Start', values); }) // Synchronize the document state by executing

Office Add-in development: Insert table in Word 2016

五迷三道 提交于 2019-12-22 11:27:46
问题 I am trying to insert a table using Office.js inside the body of a document but to no avail. I have used the following code: function insertSampleTable() { showNotification("Insert Table", "Inserting table...") Word.run(function (context) { // Create a proxy object for the document body. var body = context.document.body; body.insertTable(2, 2, Word.InsertLocation.end, ["a"]); // Synchronize the document state by executing the queued commands, and return a promise to indicate task completion.

OneNote Add in: Getting HTML content

和自甴很熟 提交于 2019-12-22 10:29:51
问题 In the example, code is provided to get RichText. It is able to get the plain text content of the page, but I cannot seem to get it to return the HTML formatted content of the page. For example: Header: A B should be: <p>Header:</p> <ul> <li>A</li> <li>B</li> </ul> However, the example code uses richText/text and only returns Header: . Is it possible to do something like richText/HTML and get the HTML shown above? (Note: I want to use the add-in only, not the OneNote REST API.) Thanks! Code

In OfficeJS, can you retrieve the range of a binding object?

与世无争的帅哥 提交于 2019-12-22 08:39:34
问题 Targeted towards Word Online, but any pointers for Excel/PPT would be helpful as well. Essentially, is it possible to treat the text within a binding object as a range? Thus, being able to select it all as well as move the caret to the beginning/end. I was envisioning the code to have something to the effect of: Office.select(“myBindingID”, function error(){}).getAsRange().select(“End”); 回答1: There is a difference between the host-specific Office 2016+ wave of APIs and the "common" (2013)

Outlook API 1.3 version not showing on Outlook Desktop Professional Plus 2016

坚强是说给别人听的谎言 提交于 2019-12-22 06:46:33
问题 On this page https://github.com/OfficeDev/office-js-docs/blob/master/reference/outlook/tutorial-api-requirement-sets.md it is specified that both Outlook 2016 (MSI) for Windows and Outlook 2013 for Windows support Outlook API up to Version 1.4, but when we try to increase the minimal version in the manifest from 1.1 to 1.3, the addin works fine on web but does not show on both desktop versions. Currently I am working on Outlook Professional Plus 2016 with build number 16.0.4312.100, 64bit on

Office Add-In Development - Malformed GET URL (_host_Info=…)

倾然丶 夕夏残阳落幕 提交于 2019-12-22 06:31:36
问题 I am currently developing a MS Word Office Addin using the JavaScript interface provided by Microsoft. I made a test implementation using a Django backend, where everything worked fine. However for the final product I have to integrate functionality with an existing Java Backend that runs in multiple configurations, which are out of my control. Consisting of Vaadin for the UI and mostly Tomcat (but not always) as a Servlet Container. I've run into the problem that the IFrame that runs inside

Pop-up blocked error when opening url from outlook webaddin

◇◆丶佛笑我妖孽 提交于 2019-12-22 01:18:08
问题 i am trying to open url when user clicks on a button in plugin view. But web addin is throwing error. My code to open url : let a = document.createElement("a"); a.setAttribute('target', '_blank'); a.setAttribute("style", "display: none"); document.body.appendChild(a); a.href = finalUrl; a.click(); document.body.removeChild(a); Error message : App is rejected from store because of this error. How can i overcome this error? I don't want to use Dialogue API which doesnot open url in the browser.

Error while executing async get of Outlook item property

梦想的初衷 提交于 2019-12-22 01:10:14
问题 Why am I getting Could not complete the operation due to error 80043200 sometimes while getting Outlook item property (for example, Subject) in email Compose mode? Call stack: Error at n.prototype.execute (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:86635) at u.DDA.OutlookAppOm.prototype.callOutlookDispatcher (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:150300) at u.DDA.OutlookAppOm.prototype.invokeHostMethod (appsforoffice.microsoft.com/lib/1