office-js

Make IntelliSense work in Visual Studio

一曲冷凌霜 提交于 2019-12-11 12:59:59
问题 I am using Visual Studio 2015, and I want to add https://appsforoffice.microsoft.com/lib/1/hosted/office.js as an IntelliSense reference. So I did the following: But the IntelliSense still does not work: Could anyone help? 回答1: Getting the basics of JavaScript IntelliSense working is pretty straightforward – all you need to do is, in your JavaScript file, have a triple slash reference to the CDN location, as follows: /// <reference path=" https://appsforoffice.microsoft.com/lib/1/hosted

How to published an Office Add-In to SharePoint for use with Excel Web App

[亡魂溺海] 提交于 2019-12-11 12:52:12
问题 I am unable locate any information on the Internet that simply makes the statement, "Office Add-ins (aka Apps for Office) only work in Desktop apps and Office Online. They do not work in SharePoint office web-parts.", if that truly is a correct statement. I have a Excel Add-in and can published it using the following instructions: https://msdn.microsoft.com/en-us/library/office/fp123515.aspx . My add-in is a task-pane add-in (https://msdn.microsoft.com/en-us/library/office/fp123523.aspx) With

Apps for Office 365 - Return selected text with styling and formatted

天大地大妈咪最大 提交于 2019-12-11 11:07:48
问题 I created an Add-In App for Office365 (Word, Excel and Powerpoint) and i want to get the selected text inside my app, with new lines and styling. I am using the following code to do that function getSelectedData(hasSelectionCallback, noSelectionCallback) { var type = Office.CoercionType.Text; Office.context.document.getSelectedDataAsync(type, { valueFormat: "formatted", filterType: "all" }, function (asyncResult) { var error = asyncResult.error; if (asyncResult.status === Office

Error when trying to edit created Document with context.application.createDocument

扶醉桌前 提交于 2019-12-11 08:45:57
问题 I am developing an office web addin, and running in Word Online. I am trying to edit a document that I have created with context.application.createDocument . Here is the code: Word.run(function (context) { var myNewDoc = context.application.createDocument(base64); context.load(myNewDoc); return context.sync().then(function () { myNewDoc.body.insertText('Hello World!', 'Start'); myNewDoc.open(); return context.sync(); }); }); I get this error at insertion of text / context.sync():

Office-JS: Excel Host API no longer available under Excel 2016 MSO

本小妞迷上赌 提交于 2019-12-11 08:37:09
问题 I'm currently running Windows 10 with Microsoft Excel 2016 MSO (16.04266.1001) 64-bit. I'm under the impression that that is the version installed via MSI. Over the course of the last few months I've implemented a React-based Excel add-in using the Excel Host APIs. Per the Excel JavaScript API requirement sets document available at the Office Dev Center, that build appears to contain the "ExcelApi 1.1, WordApi 1.1, and common API" requirement sets. As of yesterday, I am no longer able to

Disable Office 365 Outlook Add-in for desktop

喜夏-厌秋 提交于 2019-12-11 07:35:59
问题 I have developed an Office 365 Outlook Add-in for the web. It's automatically supported in desktop also. I want to disable the app only for the desktop. I guess we need to change something in Manifest file but I couldn't get any clue. Can anyone help me to achieve this?? 回答1: The Office add-in is aim to cross-platform developing for the Office solution. At present, it doesn't support to limit platform. Here is the specification of “Host“ element which used to specify the Office host

Office.context.auth.getAccessTokenAsync throws API not supported while developing Microsoft Word online add-in

人走茶凉 提交于 2019-12-11 07:35:07
问题 I am trying to develop an add-in for Microsoft Word Online. I am using Office.context.auth.getAccessTokenAsync call to get access token of a user, but it throws error: Object { name: "API Not Supported", message: "This browser does not support the requested API.", code: 5009 } status: "failed" Can anyone help? Here is code that I am using to get Token. "use strict"; (function() { // The initialize function is run each time the page is loaded. Office.initialize = function(reason) { $(document)

showHeaders=false results in unexpected Table Range using Javascript

戏子无情 提交于 2019-12-11 07:33:39
问题 I've noticed some unexpected behavior in the table object when using Excel Javascript. To demo the problem, I've slightly modified some code that came with the ScriptLab example which shows how to add columns and rows to a table. The code below comes from that example with the exception that I've added the line of code "expensesTable.showHeaders = false;" and I've commented out the line of code "expensesTable.GetHeaderRowRange() ...". The rest is identical. /** Create a new table with sample

Underline Color Word Web Add-in without Font Color

前提是你 提交于 2019-12-11 07:27:45
问题 I am working on Word web addin OfficeJS, I wanna change my underline color to red. Is it possible to change the color of underline without affecting the font color ? Attached my code below: Word.run(function (context) { var searchResults = context.document.body.search(searchResult, { ignorePunct: true }); context.load(searchResults, 'font'); return context.sync().then(function () { for (var i = 0; i < searchResults.items.length; i++) { searchResults.items[i].font.color = 'red'; searchResults

Office add-in explicitly mention platform support in manifest

自作多情 提交于 2019-12-11 07:15:15
问题 The Office add-in I am working on will be supported only for the Office Online platform. There are configuration to set Host in which the add-in will work, that can be added in manifest. Is there a similar setting/configuration available in manifest to explicitly mention that the add-in will support only Office Online platform and not Office for Windows, etc. 回答1: If you are planning to publish your Office Add-in to the Office Store (which I assume you are, since you added the office-store