惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
博客园_首页
博客园 - 【当耐特】
WordPress大学
WordPress大学
月光博客
月光博客
博客园 - 叶小钗
S
SegmentFault 最新的问题
雷峰网
雷峰网
H
Help Net Security
宝玉的分享
宝玉的分享
A
About on SuperTechFans
IT之家
IT之家
J
Java Code Geeks
Hugging Face - Blog
Hugging Face - Blog
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog

博客园 - microsoft_xin

用户属性数据库设计:如何平衡固定信息与灵活扩展? mysql数据库千万级数据量是分库分表好还是数据归档好 MySQL 优化实战:为何 DELETE + IN 子查询性能不佳,而 JOIN 却能高效利用索引? git的还原提交和撤销提交可以帮你快速回滚提交和推送 java语法使用小技巧-保留两位小数-用group对list数据分组取和 java时间常用功能工具类 Navicat或DBeaver连接MySql提示错误 Unable to load authentication plugin ‘caching_sha2_password‘ 快速测试连接SQLServer数据库的方法 nlog使用小记(日志文件分割备份循环) IDEA常用快捷键 java中两个list集合取并集、交集和差集&对list数据进行对象属性筛选 Cron表达式及格式适用于各种调度服务quartz xxljob hangfire C#客户端实现域环境内Windows认证免密码自动身份认证登录 .NET List常见操作之交集并集差集(转) mysql-查看最近执行sql脚本 SharePoint安装 OpenID Connect、SAML、WS-Federation和/或OAuth2.0 SQLServer常用SQL脚本 使用VSTO创建修改和删除outlook会议加载项(二)
使用VSTO创建修改和删除outlook会议加载项(一)
microsoft_xin · 2022-10-12 · via 博客园 - microsoft_xin

使用VSTO创建修改和删除outlook会议加载项


Outlook 解决方案
https://learn.microsoft.com/zh-cn/visualstudio/vsto/outlook-solutions?view=vs-2022
对象模型:
https://learn.microsoft.com/zh-cn/visualstudio/vsto/outlook-object-model-overview?view=vs-2022
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{            
    this.Application.Inspectors.NewInspector += Inspectors_NewInspector; 
    this.Application.ItemSend += Application_ItemSend;                      
}

private void Application_ItemSend(object Item, ref bool Cancel)
{
    if (Item is _MeetingItem meetingItem)
    {
        AppointmentItem appointment = meetingItem.GetAssociatedAppointment(false);
        if (appointment == null)
        {
            return;
        }
        string appointmentId = appointment.GlobalAppointmentID;
        // 取消会议
        if (appointment.MeetingStatus == OlMeetingStatus.olMeetingCanceled)
        {
            if (!string.IsNullOrWhiteSpace(appointmentId))
            {

            }
        }
        else
        {
            //修改会议
            if (!string.IsNullOrWhiteSpace(appointmentId))
            {

            }
        }
    }
}

private void Inspectors_NewInspector(Inspector Inspector)
{
    if (Inspector.CurrentItem is AppointmentItem appointment)
    {
        if(!string.IsNullOrWhiteSpace(appointment.EntryID))
        {
            return;
        }
        if (!string.IsNullOrWhiteSpace(appointment.Subject) || !string.IsNullOrWhiteSpace(appointment.Body))
        {
            return;
        }

    }
}

使用代码创建新会议并打开创建会议窗口:

private void CreateMeeting()
{
    Globals.ThisAddIn.Application.CreateItem(OlItemType.olMailItem);
    var appointment = Globals.ThisAddIn.Application.CreateItem(OlItemType.olAppointmentItem) as AppointmentItem;
    appointment.MeetingStatus = OlMeetingStatus.olMeeting;
    appointment.Display(true);
}

设置RibbonType以控制加载项的显示场景

设置ControlIdType和OfficeId,来控制加载项的显示位置

多个 场景显示需要复制多个Tab。