我想设置邮件项目“自定义”敏感度标签。
我查看了: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
你好,
ci-dessous ce qui a functionpour moi
'
SendKeys "%l" ' Alt + L affiche le menu message
SendKeys "AY" ' Selectionne le menu sensitivity (étiquettes de sécurité)
SendKeys "{DOWN}{DOWN} {ENTER}" ' 2eme choix puis entrer pour la sélection: j'ai essayé l'envoi direct ici avec sendkeys sans succes
'Etant donné l'envoi d'action par des raccourcie clavier il faut garentir un minimum de temps d'affichage pour l'execution de celles-ci ensuite on envoi
If Application.Wait(Now + TimeValue("0:00:03")) Then
.send
End If