office-js

How can Office Add-in (Task-pane) not display by default

☆樱花仙子☆ 提交于 2019-12-02 12:29:44
问题 I have an Task-pane Office Add-in (https://msdn.microsoft.com/en-us/library/office/fp123523.aspx) on registered Office 365 Site. When the user opens a spreadsheet from a document library on that site, then in edit mode, can use the "Office Add-ins" from the Insert menu to insert my add-in to the Spreadsheet. My add-in helps them population and update data on the spreadsheet. They then save the spreadsheet back with the updated data. Now, the next time they open that spreadsheet, my task-pane

Adding image to word document

落爺英雄遲暮 提交于 2019-12-02 10:21:32
I have written a below simple word addin to insert an image into word document, but when I execute this code , image does not get added to document. var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAsCAMAAACUu/xGAAAAq1BMVEUAAABlZVJlZVKsrJthYU+zs6Grq5ylpZazs6FlZVJfX01lZVJlZVKsrJurq5urq5xlZVKtrZ1lZVJlZVKvr52zs6GysqCoqJeqqpmzs6Grq5xlZVJgYE6zs6Gnp5mrq5yiopRjY1CRkX2rq5yzs6FlZVKRkX2goJKKineRkX2Pj3yrq5yIiHWRkX2RkX2RkX1lZVKRkX2rq5yzs6GoqJdfX02goJKHh3SHh3VrpzVsAAAAMHRSTlMAQIDHx3+Ax0Ag7qBgIA9AEFCPMLOgMO7bYKBQ24+zYNuzkY9wcAXu0oiocPFBMHYlVbK0AAAD3UlEQVRYw6SW7Y6qMBCGB0IkLfKdnB9ocFmjru7HERL03P

body.search Issue in word desktop

亡梦爱人 提交于 2019-12-02 09:29:31
context.document.body.search() is throwing an InvalidArgument exception in Word 2016 for desktops when the text to search for is larger than 255 characters. The same seems to be working with Word Online. var searchResults = context.document.body.search("TextMoreThan255Chars"); context.load(searchResults); return context.sync().then(function() { }); What you're experiencing is a limitation in Word (for the desktop). Some more information is available on Greg Maxey's site, for example. The VBA suggestion can adapted for an Office JS approach. The key point is to break the search term down into

How to insert document page number in a header with word addin?

时光毁灭记忆、已成空白 提交于 2019-12-02 09:18:09
I know how to insert footer and header, but I wonder how can I insert page number with with my word addin? 'Word.run(function (context) { var mySections = context.document.sections; context.load(mySections, 'body/style'); return context.sync().then(function () {var myFooter = mySections.items[0].getFooter("primary"); myFooter.insertParagraph(footerText.value, "End"); return context.sync().then(function () { console.log("Added a footer to the first section."); }); }); ' I finally found time to research and put this together. This code is written ScriptLab. Since ScriptLab complains about XML

How to identify the Excel Sheet changed event in office js api?

只谈情不闲聊 提交于 2019-12-02 09:01:35
问题 We have an Excel office js add-in written on angular. It has different functionalities based on the sheet the user is in. When users switch the sheets of excel, how can the application know it, so it can change the UI to match the sheet's functionalities? 回答1: There isn't a sheet-changed event. However, one workaround would be to subscribe to DocumentSelectionChanged events, then check the user's active sheet each time to see if it changed. 回答2: UPDATE May 18 2017: With ExcelApi 1.2+, you can

Publish Excel Add-in via FTP

我的梦境 提交于 2019-12-02 08:01:52
I'm playing with Excel Add-ins, and I'm not a specialist, so having read the documentation, I still find it complicated to publish and install it. Basically, all I did was the very basic Excel Add-in described in the documentation and now I'm trying to figure out how to install it in Excel. I see everywhere that this is vrey simple, all you have to do is to upload the XML manisfest file, etc. but using Visual Studio, I chose publish via FTP and I get 3 folders in my website: Content Functions Scripts These are full of js scripts, but I don't see the manifest file nor the home.css, Home.js and

Let the button open a new window

北战南征 提交于 2019-12-02 08:00:22
I want to add a button under the tab of my add-in, and clicking on the button should open a URL in a new window or Dialog box. I tried the follows: <Group id="Contoso.Tab1.Group2"> <Label resid="Contoso.Tab1.GroupLabel" /> <Icon> <bt:Image size="16" resid="Contoso.TaskpaneButton3.Icon" /> <bt:Image size="32" resid="Contoso.TaskpaneButton3.Icon" /> <bt:Image size="80" resid="Contoso.TaskpaneButton3.Icon" /> </Icon> <Control xsi:type="Button" id="Contoso.TaskpaneButton3"> <Label resid="Contoso.TaskpaneButton3.Label" /> <Supertip> <Title resid="Contoso.TaskpaneButton3.Label" /> <Description resid

Office add-in for Word desktop only

梦想的初衷 提交于 2019-12-02 07:59:17
I'm working on Word add-in and I use editing of content controls which is still not suported in Word online, I also use Binding.bindingDataChanged event which is also not supported in Word online. Without features that uses these capabilities the add-in is is not usefull at all for the users. I would like to submit the add-in to the Office store, but to make it available only in Word desktop version. For this purpose i have tried to use Requirement sets specification in the manifest xml file. I have ckecked requirement sets documentation page https://dev.office.com/reference/add-ins

1 MB response size limit with outlook web add-ins

霸气de小男生 提交于 2019-12-02 07:14:22
I'm using makeEwsRequestAsync to get the full MIME content of the email. But it looks like response size is capped at 1 MB, per the error message in the response: "ErrorMessage":"Response exceeds 1 MB size limit. Please modify your EWS request.” <GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"> <ItemShape> <t:BaseShape>IdOnly</t:BaseShape> <t:AdditionalProperties> <t:FieldURI FieldURI="item:MimeContent"/> </t:AdditionalProperties> </ItemShape> <ItemIds><t:ItemId Id="' + itemId + '"/></ItemIds> </GetItem> I need to get MIME content of messages which may exceed 1 MB,

(JavaScript API 1.3 for Office) Custom Properties GetItemOrNull

走远了吗. 提交于 2019-12-02 06:19:57
I've created this a couple days ago in which i needed help regarding how to add custom properties to a said document. First of all, I'm running Word 1701(7766.2047). Let's say I have a method In which I return a said custom property. First I'd check if the custom property has been created already. I would do this with a simple getItemOrNullObject(key) and.. If returns null Then simply create it AND return it Else return it It is of my understanding that I need to do a return context.sync().then for the object get actually loaded with data? Am I doing too much return context.sync() calls for