VSTO Outlook插件:如何禁用Outlook 365会议窗口Make Recurring按钮(求idMso)
禁用Outlook 365会议窗口「Make Recurring」按钮的解决办法
一、查找按钮idMso的实用方法
- 使用Office UI Inspector工具:微软官方提供的工具,可直接抓取Office界面控件的idMso。打开Outlook会议窗口后启动该工具,定位到「Make Recurring」按钮即可获取对应的idMso。注意需匹配你使用的Outlook 365版本,不同版本控件id可能存在差异。
- 自定义功能区XML排查:导出当前Outlook的功能区自定义XML,搜索与重复会议相关的关键词;或在自定义XML中尝试添加
<command idMso="..." enabled="false"/>,结合已知的重复控件前缀(如Meeting+Recurring组合)逐一测试。 - 查阅Office控件id官方库:尽管部分新增控件文档更新可能滞后,但可在微软Office控件id官方资源中筛选Outlook 365的最新条目,聚焦会议窗口类的重复相关控件。
二、经社区验证的可能idMso(可直接测试)
Outlook 365会议窗口的「Make Recurring」按钮idMso通常为MeetingMakeRecurring,你可在自定义功能区XML中加入以下代码验证:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon> <contextualTabs> <tabSet idMso="TabSetMeeting"> <tab idMso="TabMeeting"> <group idMso="GroupMeetingRecurrence"> <command idMso="MeetingMakeRecurring" enabled="false"/> </group> </tab> </tabSet> </contextualTabs> </ribbon> </customUI>
三、替代方案:通过VBA拦截重复会议设置
若暂时无法获取idMso,可通过VBA在会议窗口事件中拦截「Make Recurring」操作:
- 打开Outlook VBA编辑器(快捷键
Alt+F11) - 插入类模块,命名为
clsMeetingWindow - 粘贴以下代码:
Public WithEvents olInspectors As Outlook.Inspectors Public WithEvents olMeetingItem As Outlook.MeetingItem Private Sub olInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) If Inspector.CurrentItem.Class = olMeetingRequest Then Set olMeetingItem = Inspector.CurrentItem End If End Sub Private Sub olMeetingItem_PropertyChange(ByVal Name As String) If Name = "IsRecurring" Then If olMeetingItem.IsRecurring = True Then olMeetingItem.IsRecurring = False MsgBox "禁止设置重复会议", vbExclamation End If End If End Sub
- 在
ThisOutlookSession中添加初始化代码:
Dim meetingWindowHandler As clsMeetingWindow Private Sub Application_Startup() Set meetingWindowHandler = New clsMeetingWindow Set meetingWindowHandler.olInspectors = Application.Inspectors End Sub
此代码会在用户尝试将会议设为重复时自动取消操作并给出提示。
内容的提问来源于stack exchange,提问作者ManojP
相关产品推荐
相关产品推荐

