office-js

How to insert an image into Word from a URL

北慕城南 提交于 2019-12-07 16:48:32
问题 I am currently working on an Office.js add in for Word and I am trying to insert an image from a given Url. I was reviewing the Office.js documentation which is located at : InlinePicture object (JavaScript API for Word) I see that they may have a built in functionality of getting the base64 representation from a img url by "getBase64ImageSrc()" . The documentation on the dev office website is either misleading or incorrect. Looking to see if anyone has built a word-addin that inserts an

Office.context.mailbox.item.to.getAsync updates TO field with partial data

橙三吉。 提交于 2019-12-07 15:44:31
I start typing in Outlook TO field and at the same moment query every 1s TO field from the installed Add-in. While I'm still typing I expect to receive an empty array but Outlook (office-js SDK): Returns data with empty emailAddress and typed displayName Creates new address with partially typed displayName and incorrect emailAddress generated from typed data. I can handle the first issue but how to prevent the second one? Executed code: Office.cast.item.toItemCompose(Office.context.mailbox.item).to.getAsync(res => { if(res.status === Office.AsyncResultStatus.Succeeded) { console.log(res.value

Detect when item is changed in Outlook Web Add-in

荒凉一梦 提交于 2019-12-07 14:24:33
问题 I would like to update the content of my Outlook Web Add-in when Calendar event data is changed. Is there any possibility to catch kind of ItemChanged event in the web add-ins? I have found some projects with OnSend , but trying that way does not work, and there is only that event possible to catch. 回答1: Currently the feature you are specifying is not a part of the product. However, we are actively investigating what types of events would be beneficial for the platform. We track Outlook add

How should range.expandTo be used in the word javascript api

♀尐吖头ヾ 提交于 2019-12-07 13:14:27
I have created a taskpane addin for word that runs a search and will select the text between two search results. Until a couple of days ago the following code was running successfully: function onExpandTestClick() { var textToFind = "Word", range; return Word.run(function(context) { var searchResults = context.document.body.search(textToFind, { matchWildCards: false }); context.load(searchResults, "text"); return context.sync() .then(function() { range = searchResults.items[0].getRange("End"); var rangeEnd = searchResults.items[1].getRange("Start"); range.expandTo(rangeEnd); context.load(range

Office.js dialog API and multiple displays with high DPI

时光总嘲笑我的痴心妄想 提交于 2019-12-07 09:20:26
I noticed a problematic behavior of the Office.js dialogAPI . Indeed, I use two monitors one being an high DPI (3840*2160) with 250% zoom. The second one is 1920*1080 (zoom 100%). If Office is set in monitor 1 and if I open the dialogAPI (let us say with 80% default values), then the size of the dialog is computed using the extension of the two monitors. Therefore, the dialog windows becomes gigantic, span the two displays and cannot be used without resizing. Thank you Benoit. Yes this is an issue we are aware of and are currently following up. Could you try using the Dialog helper in

Excel JS Add-In works in Excel but not Excel Online

孤人 提交于 2019-12-07 01:56:28
I've built an Excel JS Task Pane add-in using the WoodGrove Expense Trends sample and have validated that it runs correctly in Excel 2016 on my machine. However, when I go to Excel Online and try to add the add-in (via uploading the manifest from my machine), I get "Your add-in manifest is not valid." I'm not sure what it is about this manifest that's valid on my machine but not in Excel Online. Anyone encountered this before or have any diagnosis ideas? It's somewhat akin to banging my head into a wall at this point. Michael Zlatkovsky - Microsoft Taking a guess from looking at the manifest,

Outlook 365 addin throws 401 unauthorized error on android outlook mobile app

半城伤御伤魂 提交于 2019-12-07 00:47:26
I am developing Outlook Add-In that will run over all modern browsers, android and iOS. I am using Managed EWS API to fetch the email and its attachment by passing ewsUrl , itemId and ewsToken in OAuthCredentials class which is my remote service. I am getting ewsToken by using Office.js getCallbackTokenAsync method from UI and passing all this information to my remote service to use the Managed EWS API to fetch email from exchange server. For browsers it works fine but when we use Outlook Mobile on Android, ewsUrl returns null which I hard-coded to https://outlook.office365.com/ews/exchange

OWA: Dialog API support

人盡茶涼 提交于 2019-12-06 21:30:26
We use a dialog in our Outlook add-in for authentication. We have logic in our add-in that first checks for dialog API support, then checks if the add-in is framed - in which case it pops a new window for authentication instead. Recently the dialog API lit up for OWA, and has caused us a couple issues. We fixed some previous issues relating to the order in which we performed authentication (we use ADAL.js ) and initializing Office. However, once we were past those, it doesn't appear the dialog can communicate back to the add-in using Office.context.ui.messageParent . Additionally, even though

Word Add-in Get full Document text?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 20:54:28
I'm writing an office-addin using the Yeoman Office generator , based on these instructions . The default add-in has a function which will get the text selected in your word document. I'm trying to modify the function to instead get the full-text of the document. My function code is as follows: function getDataFromDoc(){ Office.context.document.getFileAsync(Office.CoercionType.Text, function(result){ jQuery('#get-data-from-selection').click(getDataFromSelection); if (result.status === Office.AsyncResultStatus.Succeeded) { console.dir(result); app.showNotification('The selected text is:', '"' +

Can't get most email headers in Outlook Addin API

。_饼干妹妹 提交于 2019-12-06 16:33:48
问题 I'm trying to get all email headers from a selected Outlook email while inside an Outlook Addin. I've found the Preview API that should allow me to get the headers. This is what I have tried as of now Office.initialize = (reason) => { headerNames = ["Received-SPF"] Office.context.mailbox.item.internetHeaders.getAsync(headerNames, print); } print(asyncResult) { console.log(asyncResult.value); } The problem is when I start to put more headers, the API doesn't return them. The only ones I get