我想设置邮件项目"自定义"灵敏度标签。
我查看了:OlSensitivity枚举(Outlook(,它显示了标准的4个标签值,比如:机密标签的Outmail.Sensitivity = OlSensitivity.olConfidential
。
在我的情况下,有5个以上的标签->具有自定义标签名称的灵敏度选项。如何在Excel VBA中基于自定义标签名称检索它?
我也面临类似的问题,公司有自己的敏感度标签。我们无法使用默认编号进行选择。
我使用VBA中的SendKeys找到了解决方案。
诀窍是不要使用.Send
,而是使用.Display
。因此,一旦你显示了草稿电子邮件,然后看到键盘敲击,就可以接触到自定义的灵敏度。由于我在MS Office 365中工作,选择自定义灵敏度的键盘快捷键如下:
SendKeys "%h" 'Keystroke for ALT + h
SendKeys "y" 'Keystroke for selecting the Sensitivity
SendKeys "{TAB}{ENTER}%s" 'Keystroke for selecting the organization custom sensitivity and %s is for ALT + s to send the email
样本代码
With objMail
.To = strEmail
.Body = strBody
.Subject = strSubject
.Display
SendKeys "%h"
SendKeys "y"
SendKeys "{TAB}{ENTER}%s"
End With
还要从以下链接检查SendKeys的不同代码:
https://learn.microsoft.com/en-us/office/vba/api/excel.application.sendkeys