Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To create a Node.js event handler for the Outlook Add-In Item Send Event, follow these steps:

  1. Open your Outlook Add-In project in Visual Studio or your preferred code editor.

  2. Navigate to the Manifest.xml file and add the following code snippet to register the ItemSend event:

<Events>
    <Event Type="ItemSend" FunctionName="onItemSend" />
</Events>
  1. In the .js file of your Add-In, define the onItemSend function:
function onItemSend(event) {
   // Handle the event logic here
}
  1. To trigger the Node.js event handler when an email is sent, use the Office.context.mailbox.addHandlerAsync method to add the event handler:
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemSend, onItemSend);
  1. Save your changes and test the Outlook Add-In to ensure that the event handler is being triggered correctly when an email is sent.