Outlook add-in - Trigger JS function to execute on selecting recipient - outlook-addin

I would like to trigger a task pane to open when the user selects/changes the 'To' recipient for my Outlook add-in.
I have found the code for wiring up the RecipientChanged event:
Office.initialize = function () {
$(document).ready(function () {
Office.context.mailbox.item.addHandlerAsync(Office.EventType.RecipientsChanged, itemChanged);
});
However, I want this code to be triggered on 'startup' of composing or replying to an email as opposed to having to trigger the task pane to from a ribbon button.
Feels like I am looking for the entry point to add this event wiring to.
I am using Outlook 365 latest for this.
thanks

This is not possible today. We track Outlook add-in feature requests on ourĀ user-voice page.
It looks like the feature you want has been requested by others already. Please upvote the existing request. Feature requests on user-voice are considered when we go through our planning process.

This is possible with event based activation of your outlook adding
Please refer to this document

Related

how to display some message once user starts to compose new email

For Office 365 Outlook Web App, we would like to convert attachments to links once end user uploads them, however we didn't see an attachment notification event at current Outlook Addin.
Another approach we could do is to ask them to use our own buttons for uploading, however we need to guide end user to use our own buttons, could we add some message at top of email body like below once new email message box is displayed?
Somehow based on our research, Outlook Addin only has one event right now which is SendEvent, could someone confirm this? if so, it is rather limited.
To display a custom message use Office.context.mailbox.item.notificationMessages object. For example to add a message to current item the code may looks like ...
Office.context.mailbox.item.notificationMessages.addAsync("information", {
type: "informationalMessage",
message : "My custom message.",
icon : "iconid",
persistent: false
});
Be aware there are a maximum of 5 notifications per message and maximum length of each message text is 150 characters per Office.NotificationMessageDetails interface.
For the secondary question you would need to look at available events in Office.EventType enum. Over here you'll see few events available to Outlook app. One of them you are interested in is AttachmentsChanged which is currently available only in Preview (not released yet, but will be soon).

Office JS Outlook and update email body when composing a form

I would like to know if with Office JS Outlook addin, is it possible to set email body automatically when opening and composing an email.
I have already succeed to do it using addin commands and MessageComposeCommandSurface extension point element in the manifest.
However, my code is execution only after a click on a button in the ribbon.
Is it possible to execute my code automatically when the compose form is loading instead of having to click in a button to execute it?
Thanks a lot
This isn't a supported scenario.

Outlook 2013 customization and integration in exchange online

I want to customize the appointment window used in Outlook. I want add few custom fields. I am using VSTO (VS2013) to develop this addin.
So far I have added a button in ribbon of appointment tab. On click of which I am opening a new form with custom fields. Now when user completes the form and other appointment details and appointment is saved then along with all appointment data, custom data entered by user should also get emailed to recipients.
And also that custom data would be stored in Exchange, and later that data can be queries to generate report.
So my question is - how do override the save appointment event so that I can add additional data in appointment and also how do I save it to exchange online using office 365.
Please advise.
Thanks.
When you are using an Exchange account which is the case with Office 365. The UserProperties of an Outlook item is kept in Exchange.
You can persist the custom data in UserProperties
If you want to Save your custom data when the appoitment is saved. You should put an event handler in the AfterWrite event. See AppointmentItem event list.

Automatically insert email signature into Outlook Meeting Invite

I have been searching the web for a way to do this but no such luck. My goal is to save a meeting agenda template into an email signature which would be inserted into every meeting invite created by me.
Looking for some clues on how to do this?
Outlook 2010 and newer include the form designer.
File -> Options -> Customize Ribbon, then, in the Right Side pane, click to turn on the Developer Tab.
From there you can design Meeting Request template to your specification.
Then, to use it, you will select:
New -> Meeting Request Using -> (Your Custom Template) from the Outlook Home tab.
You can handle the ItemSend event of the Application class where you can check out the message class of the outcoming Outlook item and change the message body if required.
Think you will find the Getting Started with VBA in Outlook 2010 article helpful.

SharePoint 2010, Save As Site Template And Event Reciever Feature

I have an event reciever feature on my SharePoint 2010 site where it runs when a survey is completed or is about to be deleted or updated. When I save my site as site template, the event reciever feature is activate before I perform the save. Now when I create a subsite using the site template that I just created, I notice my event reciever feature is called because I have code in the ItemUpdating event that displays an error message telling users that they can not edit a survey response, this message appears when I try to create the new subsite. Should I deactivate the feature before I save the site template?
Yes. The template will also contain the definition of event receivers that are registered when you save the template. If you deactivate your feature you remove those event receiver registrations, and so your template won't contain those receiver registrations.
It's one of the awkward things about creating site templates in 2010 - you've gott pay attention to what features are active.