You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用getAttachmentContentAsync()获取附件内容时owa.Addins.js报异常

Outlook插件Mailbox API获取附件内容异常问题

背景与实现逻辑

  • 正在将Outlook插件的附件获取逻辑,从服务器端调用MS Graph改为使用Mailbox API实现,几周前功能正常,推送生产环境后出现故障。
  • 插件前置检查:通过Office.context.requirements.isSetSupported("Mailbox", "1.8")验证API集版本,仅在支持1.8时执行后续操作:
    • 读取模式:直接访问元数据获取附件列表
    • 撰写模式:调用getAttachmentsAsync()接口获取附件列表

故障表现

  • 用户填写表单后,遍历附件列表调用getAttachmentContentAsync()获取字节数组,但该方法的回调函数从未触发,代码也未捕获到任何异常。
  • 浏览器控制台出现未捕获Promise类型错误:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__type')
at i (owa.Addins.js:2:118601)
at owa.Addins.js:2:340142
at Lt (owa.Addins.js:2:353455)
at owa.Addins.js:2:375939
at t.invoke (owa.Addins.js:2:880266)
at h (owa.Addins.js:2:863745)
at T (owa.Addins.js:2:867431)

排查进展

  • 已通过调试器和日志确认,调用getAttachmentContentAsync()时传入的所有参数均已正确定义。
  • 12月5日测试:问题同时出现在桌面端和Web端。
  • 12月6日开启功能开关后:MacOS桌面端可正常获取附件内容,但Web端故障依旧。

内容的提问来源于stack exchange,提问作者Norman Stratton

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 23:45:38