'Is there a way to run a function in background in an outlook web add-in?
I am currently working on an outlook web add-in.
My add-in is a on message compose one. I'm closing de compose window and trying to run a function afterwards, but the function I want to execute is not executed:
Office.context.mailbox.item.close(); //Closing the compose window
executeInBack(); //This is not executed
The function is probobly not executed due to the add-in closing before the function could run.
I was wondering if there was an extention point where I cloud always execute a function?
Solution 1:[1]
Outlook web add-in work under the context of currently displayed item only. So, you need to run your action before the item is closed. Or just use a back-end service which can do the required work using Graph API after.
Solution 2:[2]
Posting as an answer, as I am unable to leave a comment to the discussion above.
I concur with Eugene; those are the only options that would work for the scenario you're after. If you're able to run the action before the item is closed, a possibility is to use another event to process the email body before it's sent (and while the compose window is active), e.g. onMessageSend (see Configure your Outlook add-in for event-based activation for further guidance).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Eugene Astafiev |
| Solution 2 | samr |
