Reputation: 31
I'm using ews-js-api-browser to develop an outlook desktop add-in.
EwsJS namespace is currently imported with a <script>
tag, like office-js library.
Office.initialize = function (reason) {
EwsJS.ConfigureForOutlook()
EwsJS.EwsLogging.DebugLogEnabled = false
}
const functionWhichNeedAttachment = () => {
Office.context.mailbox.getCallbackTokenAsync((token) => {
const exch = new EwsJS.ExchangeService(EwsJS.ExchangeVersion.Exchange2016)
exch.Credentials = new EwsJS.OAuthCredentials(token.value)
exch.Url = new EwsJS.Uri(Office.context.mailbox.ewsUrl)
exch.GetAttachments(
[Office.context.mailbox.item.attachments[0].id],
1,
null).then(res => console.log('res', res))
})
})
}
I get this error :
Object doesn't support this action ExchangeWebService.js (41867, 9)
It seems like ExchangeWebService is trying to assign a value to a forbidden keyword.
Upvotes: 0
Views: 230
Reputation: 1138
Please take a look at https://learn.microsoft.com/en-us/outlook/add-ins/web-services
there is only subset of EWS operations available using mailbox.makeEwsRequestAsync
which is internally used by ews-javascript-api for Outlook/Mail app.
unfortunately GetAttachments
is not available in mail apps.
Upvotes: 0