word add-in using OfficeJs - rest

We already developed Excel add-in using officejs with RESTful api with Batching in custom Functions.
And we wanted to achieve same in Word add-in hence kindly share example using word add-in with RESTful api.

As I understand it, you have a web API (REST architecture) and you have successfully made calls to it from an Excel custom function. Now you want to make calls to a web API from a task pane Word add-in. You should be able to do this exactly the same way that you do in the custom function. In fact, to start with, you should use the exact calling code and get the exact same data. The difference is only in the UI. You will probably want the calling code triggered by an event handler for a button in the task pane.

As per my knowledge, you need word manifest.xml file then all your business logic you can write using differences your addin by running inside excel or word
So officejs provide Host info to check running platform
I guess it will help

Related

Creating a folder from a space template via REST API

Well, I formuled this cuestion before but seems like I didnt do correctly, so I will try again explaining myself better.
Im working on a event handler in openbravo that creates a structure of folders via rest api, I have been able to make a single folder so I could make the structure via java but i need to add alot of stuff to all the folders idividually so my work will be x100 harder, so Im searching on internet a way of creating from a space template but cant find nothing, would be nice if u could lend me a hand, its my first time using Rest apis too so Im not that good on this, thx for ur time.
Something cool about Alfresco is that if you look at the Alfresco public REST API and you don't see what you are looking for you can simply write your own RESTful end point.
To do that, you use the Web Script Framework (tutorial). With the web script framework you can implement controllers using either server-side JavaScript or Java.
That gives you access to the entire foundational API of Alfresco, which includes the ability to create folders from space templates.
For example, when using Java to create a folder from a space template, you can use the fileFolderService to copy the template folder to a parent folder, like this:
fileFolderService.copy(template, parentFolder, folderName).getNodeRef();
That template variable is a nodeRef. How you get that nodeRef is up to you. One way would be to do a search for it.
So, to re-cap, write a web script. The web script can use the foundational API to create a folder from a template. Your web script can accept arguments for things like where to put the new folder, what space template to use, etc. That's up to you.

Web Addin Support in comparison with VSTO/COM based Extensions for PowerPoint

I am trying to build a Powerpoint Addin using the new JS-based stack that Microsoft has introduced. As part of the development, I am evaluating the support that the current JS libraries are providing. While VSTO/COM-based plugins have been around for quite some time, lack of cross-platform support is a challenge(especially for Mac and now Web), which is also the reason I want to opt for Web-based Addin(JS). But Powerpoint doesn't have a HOST API as Excel or Word does which makes things slightly challenging.
Thus here are the capabilities I want to have from the JS stack -
Ability to add and change the properties of shapes. While adding a shape doesn't have a specific API function, I was able to add it as an SVG object. Is there an easier way to change the properties of shapes and
Adding links to shapes to different slides.
Initiating other office apps like Excel and the ability to edit/read data from those instances.
Apply Slide Transitions.
Ability to connect other data resources through a URI.
Store state of shapes and slides.
It would be great if someone can point to the appropriate sections of the documentation which might help me find answers to this.
Most of what you are requesting cannot yet be done in a PowerPoint Web Add-in. But you can so some of it; for example, "connect to other data sources through a URI". I recommend that you look through the Develop section of the documentation.

Office.js fails to initialize in Word add-in with Angular

I'm building an (JS based) add-in for Word and it seems that I'm somehow unable to properly load (or actually, initialize) the office.js library when using the add-in in Word, both online as well as the desktop clients. I cannot execute any functions related to the office.js.
I've done some debugging and I found out that the sample projects work just fine, based on that finding I removed Angular from my add-in and it works fine that way. I load the office.js in exactly the same way in both the projects with and without angular. Is there a known incompatibility between Angular and Office add-ins? I haven't been able to find anything on this.
Actually there is a common error that I, and others, have come across several times when building angular apps in the context of an Office add-in. The office.js initialize function is there to set-up the communication between the add-in frame and the Office host application. If the office.js does not respond to the host application within 5 seconds after loading the add-in, it will fail. In this case, what happens often is that the office.js is loaded after (or by) angular, by then the 5 seconds are gone. What you should do is bootstrap angular in your office initialize. A more elaborate explanation and a guide on how to do this can be found here: https://www.itunity.com/article/building-excel-2016-addin-angular-enhanced-officejs-2637

office js change DOM loaded in task pane

I'm developing an office add-in using office-js (not using VSTO) and I want to access the DOM loaded in the task pane from the java script function-file used in the manifest extension points .
Yes, you can access the DOM loaded in the task pane from your JavaScript function-file. Think of it as if you have two browser windows or tabs and you want to communicate between them. Since the windows don't have access to a reference for one another, postMessage isn't a good solution. One option would be to use localStorage, which triggers an event on all same-domain pages when it changes.
Yes, you can access the DOM loaded in the task pane from your JavaScript function-file. Think of it as if you have two browser windows or tabs and you want to communicate between them. One option would be to use the postMessage() API to notify the task pane and include any information you'd like.
Edit: see my other answer: this solution isn't feasible since the window reference isn't available.

Word 2007 multiple BeforeClose event handling

I have office 2007 installed on the windows 7 platform.
In the Word application exists our supplier's add-in that catches BeforeClose document event and asks customer the question before exitting.
Now, I developed MY custom add-in that also catches BeforeClose document event and performs some operation.
The question is: HOW can I control, which of the "catching" will perform FIRST and which SECOND?
I need that MY add-in will work first and the supplier code will work after me, before the documnet will closed.
Thanks a lot in advance,
Milo
The only thing I can see would be the loading order of the addins. You might need to "name" your addin file so it loads first (not sure there is another way), then check if it effectively triggers first on all you system configurations.