office-js

window.opener does not work in Excel for Windows

旧巷老猫 提交于 2019-12-12 16:41:01
问题 I have built an Excel add-in, it opens a popup by window.open , then the add-in communicates with the popup site. I just realised that it does NOT work in Excel for Windows, the reason is that the popup can NOT get the host by $window.opener . To illustrate this and avoid cross-domain, I have made a xml, which refers to the add-in and the test page. It works well in Excel Online in Chrome and in IE. However, while running it in Excel for Windows, $window.opener returns undefined . Could

Automatically loading Word Task Pane Office Add-in

六月ゝ 毕业季﹏ 提交于 2019-12-12 12:23:31
问题 We are developing a Word Task Pane Office Add-in (not VSTO) for internal organization documents In Word 2013 (desktop) when we insert the add-in and save the document, when we reopen that document the add-in is automatically loaded. In Word Online, this behavior is different, the add-in doesn't get automatically loaded. The user has to manually insert the add-in every time the document is opened. Is there a way to automatically load it in Word Online? Would running our own Office Web App

How to operate on selected paragraphs from a JavaScript addin in desktop word?

拜拜、爱过 提交于 2019-12-12 11:29:50
问题 I'm trying to set the styles of all selected paragraphs from a JavaScript addin. The code works perfectly in Word Online, but I get an error when I use it in Word Desktop. The code is as follows (yes, my test style is called "Banana", and it's big and yellow): function updateParStyle(event) { Word.run(function (context) { var range = context.document.getSelection(); range.load("paragraphs/items"); return context.sync().then(function () { var items = range.paragraphs.items; // console.log

Is there is a way to insert macro to worksheet from Excel Addin?

别来无恙 提交于 2019-12-12 11:20:04
问题 I searched documentation Office Excel API, but cannot find any mentions at all, how it can be implemented. The Problem: Luck of API functionality or some sort of bugs can be solved easily by VBA macros. But, for doing that, we have only two possibilities: Insert macro manually into sheet, which will catch some event on sheet, and JS from addin will trigger that event (this solution came from very old forum (if I will find the link, I will insert it here)). Insert macro by JS code to sheet

Insert comment in Word using office.js

混江龙づ霸主 提交于 2019-12-12 10:03:13
问题 I am trying to make a Word add-in in office.js that inserts comments in the document. It seems to me the only way to achieve this is to use OOXML. I can insert the comment but my problem is that when I do so a paragraph break is inserted as well as can be seen from this image. A far as I can see it boils down to that if I am only inserting some text the content of the body looks like the following which works fine <w:p> <w:r> <w:t>Some text</w:t> </w:r> </w:p> But if I am inserting a

cors issue with Outlook Add-In

本小妞迷上赌 提交于 2019-12-12 09:18:40
问题 I am writing an Outlook Add-in and I am trying to make a fetch request to Jira. However, I am running into what I think is a CORS issue and I'm not sure how to get around it. The error message says: "[blocked] The page at https://localhost:3000/index.html?_host_Info=Outlook$Mac$16.02$en-US was not allowed to display insecure content from http://mysite.atlassian.net/rest/api/2/myself ." Is there any way to make a fetch request from an Outlook Add-in to get around CORS? My add-in is just a

Office 2016 Addin - Is possible Open remote file on startup addin?

南楼画角 提交于 2019-12-12 05:44:58
问题 Is possible open a remote file (url, xml, binary) ? For example, I open a dummy docx with Add-In (from url) then the Addin retrieve a xml docx from url and put it in opened document (replace document dummy). Is possible? Thanks. P.S.: I create a Addin and I retrieve a xml docx from url on open dummy file but I fail to put into opened document (replace). 回答1: If I understand correctly, you are close to doing what you want. Once you have the docx file, then you need to base64 encode it. Here's

Office.context.mailbox.item.body.setAsync removing original base64 from signatures

左心房为你撑大大i 提交于 2019-12-12 05:17:05
问题 I'm trying to use Office.context.mailbox.item.body.getAsync and Office.context.mailbox.item.body.setAsync Javascript methods in my Outlook add-in to add some content to the mail body. It's working really well, except when the user has an image on its signature. The image disappears and only its alt attribute is shown. If I inspect the html, the <img> element is there, but the src attribute turns into (unknown) instead of showing the original base64. 回答1: I work days on this problem without

How replace the text in a huge number of content controls via word-js?

余生颓废 提交于 2019-12-12 04:48:11
问题 I am trying to write a function which takes a list of Rich Text Content Controls and a single string as argument, and which replaces the content of all matching content controls with this string. While this works with a smaller amount of content controls, it fails with documents with a huge amount of them. I have to work with documents with over 700 Content Controls with individual titles. In this case, the code just replaces the first 66X CCs and then aborts with a GeneralException. I assume

Unable to edit cells after a setSelectedDataAsync in Excel

杀马特。学长 韩版系。学妹 提交于 2019-12-12 04:19:34
问题 I'm developing an add-in for Excel using the Office Add-ins platform. In this add-in I'm writing data to a range using the setSelectedDataAsync** function. It works fine, but after the data is written, I'm not able to delete or edit the cells (although I can select new ranges) unless I click anywhere outside the worksheet or double click a cell. I think it is an issue with Excel not regaining focus correctly (the filename in the top of the app remains grayed out). Some users seem to think