是否可以从与会者处检索约会回复?

时间:2019-02-23 02:04:48

标签: javascript web outlook office-js add-in

是否可以在Outlook Web加载项中检索参加者的状态以进行约会/会议?这是与我正在使用的代码相似的代码片段。

let item = Office.context.mailbox.item,
  requiredAttendees, optionalAttendees, totalAttendees = 0;

if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {
  requiredAttendees = item.requiredAttendees;
  optionalAttendees = item.optionalAttendees;

  if (requiredAttendees) {
    requiredAttendees.getAsync((asyncResult) => {
      console.log(asyncResult.value);
      if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
        totalAttendees += asyncResult.value.length;
        for (let i = 0; i < asyncResult.value.length; i++) {
          console.log(asyncResult.value[i].displayName + ' | ' +
            asyncResult.value[i].appointmentResponse + ' | ' +
            asyncResult.value[i].recipientType + ' | ' +
            asyncResult.value[i].emailAddress);
        }
      }
    });
  }
}

输出:

test@test.com | undefined | externalUser | test@test.com
test2@test.com | undefined | externalUser | test2@test.com
test3@test.com | undefined | externalUser | test3@test.com

appointmentResponse 未定义。

字符串化asyncResult.value: {“ emailAddress”:“ test@test.com”,“ displayName”:“ test@test.com”,“ recipientType”:“ externalUser”},{“ emailAddress”:“ test2@test.com”,“ displayName” :“ test2@test.com”,“ recipientType”:“ externalUser”},{“ emailAddress”:“ test3@test.com”,“ displayName”:“ test3@test.com”,“ recipientType”:“ externalUser” }]

asyncResult.value的屏幕截图: enter image description here

我正在寻找一些东西来指示:

  • 没有回应
  • 接受
  • 拒绝

清单片段

          <!-- appt Compose -->
          <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="apptCmdGroupId">
                <Label resid="groupLabel"/>
                <Control xsi:type="Button" id="apptCmdButtonId">
                  <Label resid="apptCmdButtonLabel"/>
                  <Supertip>
                    <Title resid="apptCmdSuperTipTitle"/>
                    <Description resid="apptCmdSuperTipDescription"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="apptCmdEntryPointUrl"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>

很显然,数据只是不在此对象上,而是对是否有办法获取该数据点感到好奇。函数getAppointmentResponse使我认为这是可能的...也许是不完整的实现?

谢谢!

0 个答案:

没有答案