office-addins

How can i get the document title in Office 365 JavaScript API?

妖精的绣舞 提交于 2019-12-11 02:12:09
问题 I am writing an office add-in with angularjs, i need to get and set document title (that seen at that the top of the document). this is my code: function run() { Word.run(function (context) { var properties = context.document.properties; context.load(properties); return context.sync() .then(function() { console.log('thisDocument.properties.title', properties.title); }) }) .catch(function(error) { OfficeHelpers.UI.notify(error); OfficeHelpers.Utilities.log(error); }); } but in console didn't

Office.context.ui.displayDialogAsync throws 5001 Internal Error

与世无争的帅哥 提交于 2019-12-11 01:22:00
问题 I'm creating a new Outlook Mail add-in using the Visual Studio project template, where I get a sample displaying properties of the currently selected email. I've added a button with a click event handler to open a dialog using this code: $('#clickMeButton').click(function () { Office.context.ui.displayDialogAsync('https://localhost/OutlookAddinTest/MessageDialog.html', { height: 40, width: 40, requireHTTPS: true }, function (result) { _dlg = result.value; _dlg.addEventHandler(Microsoft.Office

Powerpoint 2010 VSTO AddIn taskpane on multiple Windows

≯℡__Kan透↙ 提交于 2019-12-11 00:36:36
问题 I would like have a taskpane displayed on each document-windows, I have read all MSDN articles about it, but it doesn't work. I click on ToggleButton1 when 3 or 4 document are open, and i get 3 or 4 TaskPanes, but on same document window. Edit : I think i don't have correctly explain the problem, sorry. New try : I click on ToggleButton1 on Presentation 1 window when 3 or 4 document are open, and i get 3 or 4 TaskPanes inside Prestation 1 window, windows from other presentation are empty.

Word Add-in - How to read custom document property

六眼飞鱼酱① 提交于 2019-12-10 18:15:20
问题 I am developing a Word plugin using the Office JS API. Currently I can add custom properties to the Word document by doing: context.document.properties.load(); context.document.properties.customProperties.add("file-name-prop", "my file name"); If I then download the file I can see the property in the "custom.xml" file inside the zipped docx. But I am not able to read the property back. I am trying to do it like this: context.document.properties.load(); var filenameProp = context.document

Authenticating using OfficeDev/office-js-helpers rather than adal

心已入冬 提交于 2019-12-10 17:55:01
问题 I'm working on an Office Add-in that currently uses adal to obtain an auth token. As I want to use the Fabric front end I am changing it to React and I notice that the officer-js-helpers have implemented authenticators that seem to do the same job as the adal library. Am I correct in this assumption? If so, how do I duplicate this adal config using the office-js-helpers authentication functions: var adalConfig = { instance: 'https://login.microsoftonline.com/', tenant: 'myprivatesite

How to copy range formatting in office.js?

穿精又带淫゛_ 提交于 2019-12-10 17:01:31
问题 Tried the following code that I pieced together from various sources but it doesn't seem to be working. Do I need to go through each individual property and assign them one by one? Excel.run(function (ctx) { var worksheet = ctx.workbook.worksheets.getItem(worksheetName); var range = worksheet.getUsedRange(); range.load(["formulasLocal", "address", "format/*", "format/fill", "format/borders", "format/font"]); var newWorksheet = ctx.workbook.worksheets.add(worksheetName + " -Copy"); return ctx

PowerPoint Web Add-In: get data within document

五迷三道 提交于 2019-12-10 12:16:57
问题 Is it possible to get all data in PPT document? Something like getSelectedDataAsync method but for all data whether selected or not. I want to verify the content(Text) of the PPT document. 回答1: The PPT JS API is not yet as rich as the Excel and Word ones, and today there is no API to do this directly. There is an intricate workaround where you need to get the entire file (pptx) (using the getFileAsync method) send it to service that uses the OOXML SDK to open it and grab the content you need.

Change value of a table in content control

╄→гoц情女王★ 提交于 2019-12-10 11:15:33
问题 I created a Word add-in and I insert a table in Word 2016 (version 16.0.7341.2029) using the Word API 1.3 like this: var value = [[3,4],[5,6]]; Word.run(function (ctx) { var table = ctx.document.body.insertTable(value.length, value[0].length, Word.InsertLocation.end, value); var myContentControl = table.insertContentControl(); myContentControl.tag = 'MyTable1'; myContentControl.title = 'This is a table'; return ctx.sync() .then(function () { console.log('Table created'); }).catch(function

PowerPoint command like insert slide or apply theme equivalent on Office javascript API

微笑、不失礼 提交于 2019-12-10 09:46:40
问题 I'm developing a PowerPoint add-in and in future, it will be publish in Office Store. But it is VSTO project (C# and winforms) which could not be publish. Based on my search, it must be Office Web Add-in project (manifest xml and web pages). I'm trying to convert my development from VSTO to Office Web Add-in but some of functionalities like open presentation, insert slide and apply theme aren't found on the Office.js. Is there equivalent functions in Office.js? or other way? Hopefully someone

How to get working Dialog API of OfficeJS API with Outlook 2016 desktop client

◇◆丶佛笑我妖孽 提交于 2019-12-10 06:28:55
问题 I developed a outlook add-in which using OfficeJS API and want to implement OAuth within app, also API Documnetation says Outlook 2016(Desktop) supports requirements set 1.1, 1.2, 1.3 & 1.4 but in my case it remains silent not even throws an error. While running working dialog api sample for word add-in i am getting JavaScript run-time error: Unable to get property 'displayDialogAsync' of undefined or null reference . I am using Microsoft Office Professional Plus 2016. Code I wrote to launch