Are there more methods for the "application" object? - excel

Am I right to conclude that I may have to wait for certain objects and methods to appear in order to launch one office App from another?
I'm trying to link a number of Excel lines (customer interactions) one to one with OneNote pages.
I cannot find Office-js methods equivalent to those used in this VBA. I looked in the Office.js documentation and see only a couple of methods.
It is perfectly possible that I'm barking up the wrong tree.

This isn't possible with using Office.js. It's important to remember that each Web Add-in runs within its own sandbox and is essentially just a web app. It simply isn't possible for a Web Add-in to determine what other applications you have and remotely execute code against them (nor would you really want this if you consider the potential security risks that would open up).
What you can do however is leverage Microsoft Graph to interact with OneNote. So rather than having Excel drive OneNote over COM, you have your Web Add-in act as middleware between the current Excel Worksheet and a user's OneNote Notebook. You Add-in uses Office.js to communicate with the Worksheet and make REST calls to Microsoft Graph to interact the Notebook.
The first thing you'll need is an Access Token for the Excel user to use with Microsoft Graph. You can obtain this using the getAccessToken() method in Office.js. The steps for setting this up can be found at Authorize to Microsoft Graph in your Office Add-in (preview).
The second thing you'll need is to call Microsoft Graph. Assuming you want to keep things simple, I would use the Microsoft Graph Client SDK for Javascript for this. You'll also want to take a look at the OneNote API overview
from Microsoft Graph's documentation.
There are also some samples in OneNote's GitHub. Although none of the samples are exactly what you're looking for, they may still provide some valuable insights into how the API works.

Related

How do I distribute excel office add-in(w/ office.js) in privately?

Q1. Are there any method to distribute excel office add-in(w/ office.js) in privately?
(Will office.js add-in also be distributed like VSTO's .exe OR .xla/.xlam macro files with password?)
Q2. If I run office add-in server(node.js) on my on-premise server, What will have to be distributed to the end-users?
(I want to hide the core source logic unlike VBA macro.)
I am now developing an excel office add-in. But there seems to be some limitation to deploy to the end-users in my company.(We are now testing environment for pilot, and using office 365 but it is restricted by IT's policy)
When I refer to the official documentation below, the docs says that the way to deploy add-in in privately are Microsoft 365 admin center OR SharePoint catalog.(AppSource is publicly for everyone.)
refer. https://learn.microsoft.com/en-us/office/dev/add-ins/publish/publish
However, it seems that it have to use Microsoft's services or components like SharePoint or admin center. I don't want to use these items because I want to flexibly cope with various environments.
I have also read the article as below.
refer. How to distribute private office add-ins?
But the reply thread seems that the writer couldn't get the appropriate answer what I also want to know.
I want to know the other ways to distribute excel office add-in(w/ office.js) without unveiling my core source logic and what is the minimum materials I have to provide to the end-users(i.g. manifest or something).
Typically, as you have already know, you need to host the add-in's source code on the web server anywhere. The manifest file just refers to the place where the sources are stored. And the single file which should be provided to be able to side-load add-ins locally is the manifest file. Everything else is hosted under your control.
Due to the nature of the web technology you can't hide the source code from users. The add-in acts like a regular web page. The best what you could do is to obfuscate your code.

Excel Javascript API - Sharing

(Desktop version) I'm new to using the javascript API for excel, but is it possible to create an excel add-in and share with other users without having to add the add-in to an app source etc? Can it be embedded in the excel file etc. I'd like to share scripts with other users the same way that I can share VBA if it's possible?
for security reasons as well as to make manageability of your add-ins easier, we do not store the code within the workbook, like VBA. Instead, the javascript is hosted on your website and we have a reference to your add-in saved in the workbook.
What this means, is to get a similar experience to VBA, you must either have the add-in hosted on app source (which will make it accessible via the Office Store), OR each user in an organization must have the add-in deployed or available to them (here we recommend centralized deployment as it will give the most robust experience).
This has all the current deployment options you can use for Office add-ins: https://learn.microsoft.com/en-us/office/dev/add-ins/publish/publish
thanks!

Consume external API from within OfficeJS

I'm currently working on creating my first ever Office 365 plugin specifically for Excel. I would like this plugin to be able to make REST API calls to an external service(either a micro service or a Lambda). I haven't written the REST service yet but want to know if this is even remotely possible from within Office JS. I found a similar question asked Use Office.js APIs from outside an Office Add in back in 2016 when Office-JS was brand new. Just wanted to know if there is better support for REST API from within Office-JS and if so where can i find specific documentation to accomplish this.
Yes. You can do this. Any REST API that can be called in a web app can be called from an Excel Add-in because the add-in essentially a web app embedded in Excel. E.g., the same ajax request that would work in a web app would work in the add-in.
I think the question that you linked to is different. It seems to be about the Excel REST APIs which are not the same as the Office.js.

Excel add-in interaction with other Office365 applications

I'm exploring Office 365 development and I'm trying with Excel add-ins.
One thing I'd like to was to interact with other Office applications, like Outlook, OneDrive and Word - from Excel.
For example, I'd like to send an email from an Excel table and/or insert the value of a cell in a Word document.
After searching the documentation, I couldn't find if this is possible, so I'd appreciate some help.
I'm new to Office development.
Thanks in advance!
Add-ins (Office.js) run in separate instances of browsers (controlled by the Office apps). This makes it difficult to pass messages between apps. Browser storage (cookies, localStorage and IndexedDatabase) can't consistently see each other's data/events when in separate instances. Because of this, we had to pass messages through our servers just to communicate between Excel, Word, and PowerPoint on the same device. Microsoft currently does not provide an API to communicate between add-ins in different apps.

Is it possible to develop for Office 365 (confusion due to new-to-365)

I'm not even sure if it's possible at all. Earlier, I've been designing addons to Outlook and Excel (using VSTO and VBA). Now, my company got into this Office 365 thinking and we have all our environment online, no local software at all, strictly and only web client approach.
It's got its advantages. But the downside is that out support have no clue how it works (except to tell us to click the settings and look for options, sigh). So, I wonder if it's possible to develop and somehow upload my own customizations (NB we have no servers in the cloud - everything is provided on SAS basis).
Suppose I'd like to:
mark all emails from a certain sender with yellow background in the list in Outlook, or
highlight every occurrence of the word "donkey" in the text mass in Word.
Is it doable at all?
I've googled for it but all I can see is that there's an API and that we need to runt the stuff on our own servers. Am I just confusing myself here?
First of all, if you have O365 subscription, you actually still have the ability to download all desktop version of Office. So your existing customizations should still work on Desktop version of Office.
Second,check out Office Add-in on dev.office.com. Office Add-ins extend the functionality of Office with a web app that lives within Office applications. They work similar to traditional VBA add-ons and we have a rich set of API that helps you interact with Office. This is basically a web app with JavaScript, HTML and CSS. You can build it with any tools you are familiar with and host it anywhere. It is really easy to build and let us know if you have more questions.
Thanks,
Sky
Your best bet for highlighting messages from specific senders would be to use the Outlook REST APIs to access the messages and either stamp a specific category color on the messages, or a flag to highlight the message in the list view. That approach would work across both Web, Outlook, and even Mobile (if you use flags). The new Outlook add-in model is powerful and works for Outlook on the Web, as well as Outlook on Windows, but doesn't allow you to update the colors of the list view add-ins.

Resources