在MS Outlook加载项中设置收件人

时间:2019-02-13 23:09:39

标签: outlook outlook-addin outlook-web-addins

我正在尝试将recipient动态添加到requiredAttendees以便进行Outlook约会

var arr = [{emailAddress: 'test@example.com', displayName: 'Test Name'}]
Office.context.mailbox.item.requiredAttendees.addAsync(arr)

(also fails with arr = ['test@example.com'])

它抛出一个错误

Sys.ArgumentException: Sys.ArgumentException: 
Value does not fall within the expected range.

那怎么实现?

Cf。 docs which I am following

Cf。 Radio-silence Github issue


更新屏幕拍摄

Array.isInstanceOfType before Throw

PRE-THROW

  • 您会注意到n已正确定义为具有1个值的数组(右侧)
  • 从控制台检查与arr相同的数组将得出true

Outlook Recipients Array Throw Error

投掷

  • 脚本处于评估状态throwing(如浅绿色突出显示所示)

1 个答案:

答案 0 :(得分:1)

要获取动态URL参数,我在O​​ffice初始化完成后正在加载iframe onInit

尽管传入的iframe可以使用其余的API,但是该API的固有部分必须依赖于window

将API调用移至iframe之外可解决此问题,并使它按预期工作。

相关问题