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

如何通过Outlook Object Model在Outlook中创建约会并添加Teams会议链接

在C#中通过Outlook Object Model为会议添加Teams会议链接

Outlook Object Model本身没有直接生成Teams会议链接的API,但可以通过配置会议属性,让Outlook自动创建Teams会议并生成对应的链接,无需手动拼接。

核心实现步骤

  • 先将会议状态设置为olMeeting
  • 新增设置MeetingType为OlMeetingType.olTeamsMeeting(该枚举仅在Office 365/Outlook 2019及以上版本的Interop库中支持)

修改后的完整代码

using Outlook = Microsoft.Office.Interop.Outlook;

Outlook.Application outlookApp = new Outlook.Application();

Outlook.Folder calendarFolder = outlookApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar) as Outlook.Folder;

Outlook.AppointmentItem newAppointment = calendarFolder.Items.Add(Outlook.OlItemType.olAppointmentItem) as Outlook.AppointmentItem;

newAppointment.Subject = "测试Teams会议";
newAppointment.Start = DateTime.Now.AddHours(1);
newAppointment.End = DateTime.Now.AddHours(2);
newAppointment.MeetingStatus = Outlook.OlMeetingStatus.olMeeting;
// 启用Teams会议,Outlook会自动生成会议链接并插入到正文
newAppointment.MeetingType = Outlook.OlMeetingType.olTeamsMeeting;
newAppointment.Body = "会议内容说明";

// 添加参会者并解析确保有效性
Outlook.Recipients recipients = newAppointment.Recipients;
recipients.Add("attendee1@example.com");
recipients.Add("attendee2@example.com");
recipients.ResolveAll();

newAppointment.Save();
newAppointment.Send();

注意事项

  • 必须确保引用的Microsoft.Office.Interop.Outlook版本支持OlMeetingType.olTeamsMeeting,低版本Office(如2016及以下)无此枚举
  • 需先设置MeetingStatus为olMeeting,再配置MeetingType,否则不会触发Teams会议生成
  • 保存并发送会议后,Outlook会自动将Teams会议链接添加到会议正文和会议详情中,参会者可直接通过链接加入会议

内容的提问来源于stack exchange,提问作者Shady Adel

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.20 08:12:43