I'm trying to create an Outlook add-in for testing purposes but I'm stuck with a weird behaviour. I declared, in my XML Manifest the following keys:
<FunctionFile resid="functionFile" />
<Action xsi:type="ExecuteFunction">
<FunctionName>myEntryPoint</FunctionName>
</Action>
The 'functionFile' is my HTML file that contains the Javascript code.
In that HTML file, I've the following code:
(function () {
Office.initialize = function (reason) { //Nothing here };
})();
function myEntryPoint(event) {
Office.context.mailbox.displayNewMessageFormAsync({
toRecipients: ["[email protected]"],
subject: "Test Subject",
htmlBody: "Internet headers: ",
}, function (result) {
console.log(result);
});
event.completed();
}
In fact, the method displayNewMessageFormAsync is executed but not the callback (console.log(result)).
If I put that code in the 'Office.initialize' function, the callback function is executed.
Any idea?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…