hlaliberte
hlaliberte

Reputation: 99

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?

Upvotes: 0

Views: 305

Answers (2)

samr
samr

Reputation: 64

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).

Upvotes: 1

Eugene Astafiev
Eugene Astafiev

Reputation: 49445

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.

Upvotes: 0

Related Questions