[英]Can I use GetInspector.CommandBars.ExecuteMso to set a permission option on an Outlook Email?
I am trying write an Outlook Add-In that would create an email, set a specific permission from the Permission dropdown in Outlook to encrypt the email, and then sent out the email. The encrypt permission come from an Information Rights Management template.我正在尝试编写一个 Outlook 加载项,它将创建一个 email,从 Outlook 的权限下拉列表中设置特定权限以加密 email,然后发送 email。加密权限来自信息权限管理模板。 To access the specific permission.
访问特定权限。 I am trying to using
mailItem.GetInspector.CommandBars.ExecuteMso
我正在尝试使用
mailItem.GetInspector.CommandBars.ExecuteMso
I am trying to determine:我正在尝试确定:
mailItem.GetInspector.CommandBars.ExecuteMso
?mailItem.GetInspector.CommandBars.ExecuteMso
中使用哪个 Mso? I've tried mailItem.GetInspector.CommandBars.ExecuteMso("PermissionRestrictMenu")
, which give me the error Message: Value does not fall within expected range我试过
mailItem.GetInspector.CommandBars.ExecuteMso("PermissionRestrictMenu")
,它给我错误消息:值不在预期范围内
and mailItem.GetInspector.CommandBars.ExecuteMso("PermissionRestrict")
which selects the default permission, which is not the option I am looking for.和
mailItem.GetInspector.CommandBars.ExecuteMso("PermissionRestrict")
选择默认权限,这不是我正在寻找的选项。
The CommandBars.ExecuteMso method works on controls that are built-in buttons
, toggleButtons
, and splitButtons
. CommandBars.ExecuteMso方法适用于内置
buttons
、 toggleButtons
和splitButtons
的控件。 There is no menus in the list of supported UI controls.支持的 UI 控件列表中没有菜单。
As a possible workaround you may use any low-level API exploring tool such as MFCMAPI
or OutlookSpy
for checking properties set after changes made in the Outlook UI.作为一种可能的解决方法,您可以使用任何低级 API 探索工具(例如
MFCMAPI
或OutlookSpy
)来检查在 Outlook UI 中进行更改后设置的属性。
Another workaround is to use Microsoft Active Accessibility API which is a Component Object Model (COM)-based technology that improves the way accessibility aids work with applications running on Microsoft Windows. It provides dynamic-link libraries that are incorporated into the operating system as well as a COM interface and API elements that provide reliable methods for exposing information about UI elements.另一种解决方法是使用Microsoft Active Accessibility API,它是一种基于组件 Object Model (COM) 的技术,可改进辅助功能与在 Microsoft Windows 上运行的应用程序配合使用的方式。它还提供并入操作系统的动态链接库作为 COM 接口和 API 元素,它们提供可靠的方法来公开有关 UI 元素的信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.