Read parameters from Outlook 365 Add-In manifest - outlook

Is it possible to get the parameters from the Outlook 365 add-in manifest programmatically (like version number or maybe resources)? I've searched all over the internet, but haven't found any way to do it yet :(
Some background: I need some information to be available at run-time from the manifest settings (the customers are expected to install the add-in via manifest and it is to be tailored for each customer with some special data).
Thanks in advance!

The manifest file is only consumed by the client (i.e. Outlook or Word) for the purposes of rendering that add-in (i.e. the URL, buttons to display, minimum requirements, etc.). There are currently no APIs that expose manifest data to the add-in instance itself.

One idea: what if you put the special data as something encoded in the start URL? That way you could read it back out via JavaScript, simply by looking at what parameter got passed in to you. Would that work?

Related

Replicate the share email to microsoft teams function

I am currently investigating a way to share emails from our desktop application. Written in c# using .Net framework 4.7
We would like to use the same dialog that gets initiated when you use the "Share to Teams" button in outlook passing in the .eml file. The user would be responsible for selecting which people or channels to share to.
Does anyone have any recommendations?
We can succesfully build a simple url share using their launcher concepts, but this is pretty limited to the browser and doesn't support files
https://teams.microsoft.com/share?href=www.stackoverflow.com&msgText=Testing
https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/share-to-teams
And there is nothing mentioned in their deep-links section on msdn to achieve this
https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links
If you're building your own desktop app experience anyway, why not use Graph for this? For instance, see https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http . You'd need to do your own Search box, but you can do that on Graph also - here for instance is a channel listing endpoint (this example is for within a specific Team): https://learn.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-1.0&tabs=http

How to show outlook add-in in the main pane instead of compose and read context

It's my first time developing add in for outlook, i'm tryng to do an add-in that interact with outlook calendar to find an appointment, but i can only show up the add-in when i create new appointment, is there any way to show it outside compose and read context? like viva insights do?
i found that this can be done with VSTO, but i need it to work also with web outlook and other os, if someone can help me to figure it out i will apreciate.
i tried to do it following the add-in doc
https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points
i can't find an extension point that fits my purpose.
Thank you
Add-ins are only valid in Mail/Calendar individual item context currently. Hence, if no item (email / event) is selected, addins do not show-up or work - it does not know in which context it is suppose to run.
If your scenario requires it to run without email/event context, we suggest you to file a feature request here: https://aka.ms/M365dev-suggestions

Copying Email message to another folder in Outlook Web Add-in

I've looked at the "outlook add in command demo" example that shows how to access properties of email messages and change them via REST.
However, I cannot seem to find how I would go about copying a message from (e.g. the Inbox) to another folder in the mailbox.
The example uses REST, which does not seem to be exposing a method or call to copy a message to another folder. Would I need to use Graph to copy a message, and if yes, how is this done from within an Outlook Add-in?
Also, the documentation says REST is deprecated for Outlook add-ins and Graph should be used instead. Is there an Outlook Add-in sample that uses Graph?
The example also shows how the add-in can work on iOS, but not on Android. Has this support in the meantime been added? Is there any newer example that shows how an Outlook add-in can work on all platforms including Android?
You should now use Graph in place of Outlook REST which is now deprecated. To call Graph via outlook add in, check this documentation. Graph call to copy a message from 1 folder to another is POST /me/messages/{id}/move, find more info here.
The Outlook Add in does have support for Android, please have a look here

How to share user roaming settings between Outlook COM/VSTO and Office JS Add-in

Is it possible to share user’s roaming settings and preferences between COM/VSTO Outlook and Office JS Add-ins?
Scope
The following article covers an approach for developers to make a bridge between COM/VSTO Outlook Add-in and Office JS Add-ins to share user’s roaming settings and preferences.
Introduction
There are plenty of companies who deliver reach experience to their customers through COM/VSTO Outlook Add-ins for ages and Outlook 2000 to the latest version support is normal for them. With maturity of the Microsoft Office Store and technology behind Office JS Add-ins more and more companies looking to implement their existing solutions using Office JS API. Ability to write once and distribute easily the application for environments where Office works is very attractive point. But what about customers who still use old reliable Office 2010 or even older. You may say: “Let them use our old COM Add-in and don’t look back”. Well this may be valid point until this customer start to use Outlook for Web and realize you’ve created the Add-in for this environment as well. Great! Start using it … but wait a second, where are my settings and preference I set at my work place when used desktop solution for Outlook? What if I would like to change my preferences? Now I have to do that twice? A developer would say: “Move on to our new solution, forget about old COM”. But users probably have a reason why they use old Outlook version with COM Add-in at work and OWA with new Office JS Add-in remotely (during a trip, work from home, etc.). The reader probably got my point by now. As the developer, you may want to make life of those customers simpler by sharing the preferences between your brand new and shiny Office JS Add-in as well as your old, but solid and full of features COM/VSTO solution. So, let’s find out how to do that.
Office JS Add-in Roaming Settings
Right from the requirement set 1.0 Office JS API RoamingSettings object was introduced with four methods to manipulate with user settings. You are able to set, get and delete any custom value of the user setting/property type of {String|Number|Boolean|Object|Array}. This object keeps those settings per user mailbox and will be available to your Office JS Add-in from any location, device, etc. True roaming to keep your user’s preferences and settings, isn’t it? Please note: You should not use this object to keep sensitive information such as user credential or security tokens. The following example demonstrate usage of the object:
// Get the current value of the 'myKey' setting
var value = Office.context.roamingSettings.get('myKey');
// Update the value of the 'myKey' setting
Office.context.roamingSettings.set('myKey', 'Hello World!');
// Persist the change
Office.context.roamingSettings.saveAsync();
COM/VSTO Add-in for Desktop Outlook
Let’s return to our COM/VSTO solution. There is the single pre-request: to handle the settings which were stored in the user’s mailbox developer needs to know Office JS Add-in ID as the RoamingSettings are stored per add-in and per user. Well, you would know it indeed, as this is your/your company Add-in. The settings we are looking for are stored in the message property, which is stored in Associated contents table of the Inbox folder may be accessed using IMAPIFolder interface. Wow, this was the key sentence from entire post and needs to be explained in details.
First you would need to enumerate all messages in associated contents table and find the message with the class “IPM.Configuration.ClientExtension.00000000000000000000000000000000”, where zeros must be ID of your Office JS Add-in.
When message selected, you would need to get “PR_ROAMING_DICTIONARY” Property.
This property will contain serialized data we stored as roaming setting when used Office JS Add-in in our example above:
<?xml version="1.0" encoding="utf-8"?>
<UserConfiguration>
<Info version="Exchange.12" />
<Data>
<e k="18-ExtensionSettings" v="18-{"myKey":"\"Hello World!\""}" />
</Data>
</UserConfiguration>
Your COM/VSTO Add-in will be able to read and modify those settings with simple parse. You may want to expose your COM Add-in user setting as well. Usually those settings developers keep in HKCU Windows Registry, to roaming world per user mailbox. The benefit of this not only in capability between Office JS Add-in, but separated set of settings of your Add-in per user mailbox. When those settings created from Desktop Outlook use different info version, for example:
<Info version="Outlook.16"/>
Conclusion
As the final note on the topic I would like to illustrate the simple example of shared settings of an application from the same provider where COM and Office JS Add-ins share user settings.
References
https://dev.outlook.com/reference/add-ins/RoamingSettings.html
https://msdn.microsoft.com/en-us/library/office/cc842083.aspx
https://msdn.microsoft.com/en-us/library/office/cc842374.aspx?f=255&MSPPError=-2147217396
https://msdn.microsoft.com/en-us/library/office/cc842386.aspx

Providing feedback based on the names or emails addresses in the 'To:', 'CC:' and 'BCC:' text fields while composing an Outlook email message

When composing an outlook message, I would like to provide non-invasive feedback to the user regarding whether the email is being sent to email addresses on approved domains.
For example, if the user is sending an email where the 'To:', 'CC:' or 'BCC:' text fields contains an email address which does not end in '#AnEmailAddress.com' then a warning of some kind should be displayed appropriately.
The warning could be a single icon which shows red or green, or perhaps each name/email address can be formatted on the 'To:' et al text fields directly, in order to provide the feedback.
I've done some digging with no specific results. I'm not sure if this can be done with VBA or the scripting within Outlook forms. Or perhaps an add-in needs to be written via .net?
Any pointers greatly appreciated.
This is a good candidate for .NET add-in. Not sure if you can do that from VBA.
Depending on the range of Outlook versions you need to support, you may want to go for VSTO add-in (separate builds for different versions) or NetOffice (one build for nearly all versions). Both have pros and cons so you need to be more specific to make a choice.
If you already compose your outlook messages with for example C# than use it also to implement some kind of alerts you want..
You question is - VBA, scripting or .NET?
My answer: it depends on your skills and preferences

Resources