jfolpf's avatar
jfolpf
Brass Contributor
Mar 18, 2022
Status:
New

Outlook ItemSend event as a standard Office.EventType usable in Taskpane code

Right now, if we want to perform some actions when the user clicks the button Send in Outlook, we need to create ExtensionPoint event in the manifest

 

<Hosts>
  <Host xsi:type="MailHost">
    <DesktopFormFactor>
      <FunctionFile resid="Taskpane.Url"/>
      <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
      <!--some stuff-->
      </ExtensionPoint>
      <ExtensionPoint xsi:type="AppointmentAttendeeCommandSurface">
      <!--some stuff-->
      </ExtensionPoint>
      <ExtensionPoint xsi:type="Events">
        <Event Type="ItemSend" FunctionExecution="synchronous" FunctionName="validateBody" />
      </ExtensionPoint>
    </DesktopFormFactor>
  </Host>
</Hosts>

Problem is, this creates a totally new instance for the event with no communication with the Taskpane code; furthermore the ItemSend event is also triggered when the Taskpane is closed, and there's no way to tell in the ItemSend function if the Taskpane is opened or closed.


Thus I propose a much simpler and practical solution which would be to have the ItemSend event as a common 
Office.EventType and then simply using addHandlerAsync.

Then in the Taskpane JS code we could detect when the user clicked the ItemSend button and then perform some actions.

No CommentsBe the first to comment