次の方法で共有


Office.MailboxEnums.Days enum

曜日または曜日を指定します。

注釈

[ API セット: メールボックス 1.7 ]

適用できる Outlook モード: 新規作成または読み取り

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-appointment-organizer.yaml

// Important: Can only set the recurrence pattern of an appointment series.

const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1, currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);

const pattern: Office.Recurrence = {
  seriesTime: seriesTimeObject,
  recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
  recurrenceProperties: {
    interval: 1,
    dayOfWeek: Office.MailboxEnums.Days.Tue,
    weekNumber: Office.MailboxEnums.WeekNumber.Second,
    month: Office.MailboxEnums.Month.Sep
  },
  recurrenceTimeZone: { name: Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};

Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
  if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
    console.error(`Failed to set recurrence. Error: ${asyncResult.error.message}`);
    return;
  }
  console.log(`Succeeded in setting recurrence pattern ${JSON.stringify(pattern)}`);
});

フィールド

Mon = "mon"

月曜日

Tue = "tue"

火曜日

Wed = "wed"

水曜日

Thu = "thu"

木曜日

Fri = "fri"

金曜日

Sat = "sat"

土曜日

Sun = "sun"

日曜日

Weekday = "weekday"

週の日 (週末を除く): '月'、'火'、'水'、'木'、および 'Fri'。

WeekendDay = "weekendDay"

週末の日: 'Sat' と 'Sun'

Day = "day"

曜日。