Close add in task pane from button inside add in - outlook

I have an Outlook add-in and I'd like to close the add-in when I click on the "Close" customized button that I have inside the add-in and not on the "Close" - 'X' button of the add-in.
I was trying to find a reference inside the Outlook add-in documentation but without success.
Which office API request I need to use? any link/reference to it?
Thanks

Currently the API to close the add-in is not there. We track Outlook add-in feature requests on our user-voice page. Please add your request there. Feature requests on user-voice are considered, when we go through our planning process.

Related

How to track active screen in outlook mail using add-in

i'm running timer on task pane Add-in in outlook. when user inactive means if user switch to other tab I need to stop timer and when user back click on outlook mail, I need to resume timer. can anyone guide how to do this?
OfficeJS doesn't provide any events for that. You may consider posting your suggestion to the Tech Community at https://aka.ms/M365dev-suggestions, feature requests are considered when the team goes through our planning process. Don't forget to use the Github label: “Type: product feature request”.
In case of COM based add-ins (VSTO) you could handle the Inspector.Activate an Inspector.Deactivate events for the inspector windows in Outlook. If you need to deal with Explorer windows you may consider using the Explorer.Activate

Is it possible to launch the taskpane if certain conditions are met?

I want the user to press on a command button which will run an API. If the API returns results, I want this to launch the taskpane and then display the result of the API.
Is this possible?
If we speak about web add-ins the task pane is launched by the button click independently of API results. At runtime you may decided what to display on the task pane.
But if you mean a custom task pane as a part of COM add-in you can do whatever you like - hide, show and etc.
For web add-ins, launching a task pane after running some code/API is not possible today. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.
Here are two alternatives I would suggest considering to see if they can work for your scenario
adding a command with ExecuteFunction as an action https://learn.microsoft.com/en-us/office/dev/add-ins/reference/manifest/functionfile and launching a dialog (displayDialogAsync)
Or, run ExecuteFunction that adds notification message with an action link that user can click to open a taskpane https://learn.microsoft.com/en-us/javascript/api/outlook/office.notificationmessageaction?view=outlook-js-preview

Office Outlook add-in (web) how to know if new mail arrive

I'm trying to develop an add-in in office outlook where add-in should automatically read incoming emails and process my logic to it. I have developed the functionality when I have to specifically click the email to process my logic. But I want the functionality where the add-in should automatically process all incoming emails without manually clicking them.
Have implemented below points as of now:
outlook pinnable task pane
Item Changed Event
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, ItemChanged);
function ItemChanged(eventArgs) {
/*code*/
}
This is currently not possible. The addins are tied to the item in the view and hence the item needs to be selected for the add-in to work on. We track Outlook add-in feature requests on our user voice page. Please add your request there. Feature requests on user-voice are considered, when we go through our planning process.

Outlook Add-ins closing when a new email is opened

Whenever I have an add-in open in outlook, it closes immediately when I open a different email. Is there a way to keep an add-in open while I browse through multiple emails? Or is outlook coded in such a way that forces the add-in to close every time you click on a different email?
Thanks.
As far as I understand your questions you are the user of the Outlook Add-on. If this is correct, you will not be able to change this behavior. Every time you switch the item you would need to click to invoke the add-on once again. You may also contact the developers of this add-on and request them to implement a pinnable taskpane with explanation of your business case.
Well, if I was wrong and you are the developer of this add-on, you should look at pinnable taskpane in Outlook. This would cover exactly the case you have described. What you would need to do is just support VersionOverrides v1.1 schema in your add-on manifest as well as register and implement the Office.EventType.ItemChanged event handler in your add-on JS implementation.

Showing the in-mail add-in bar in Outlook

Feel kinda silly for having to ask, but anyway... I seem to be missing the add-in toolbar shown inside of an e-mail which for instance contains the button to watch an address in Bing maps. The entire bar is missing. I tried finding an option to view it, that doesn't seem to exist (so it cannot be disabled either :)). Also tried making my O365 the only Outlook account since I have a corporate account where add-ins are not enabled.
To be clear; it's the bar as shown in this video by Jeremy Thake: https://www.youtube.com/watch?v=XDBMI9OcqBQ, the entire bar is missing in both Office 365 OWA and the desktop client, from multiple PC's. Other add-in stuff does work, like the Boomerang add-in pane in an e-mail. I sent myself some e-mails with addresses in them (including the sample ones) to be sure it should trigger, but nothing happens. What am I missing here?
From the desktop Outlook client, click File -> Info -> Manage Add-ins. It will launch the Manage add-ins page in the Outlook Web Application (or click the gears icon in OWA and choose "Manage add-ins"). Do you see the Bing Maps add-in listed? If not, click the + icon and select "Add from the Office Store" and look for the Bing Maps add-in.

Resources