如何使用 Access VBA 将 Azure 信息保护标签应用到 Outlook 电子邮件?
我在MS Access数据库中具有VBA功能,该功能生成Outlook电子邮件,并从共享收件箱中发送它们。
我们公司使用Azure信息保护来保护文件。在发送每个电子邮件之前,需要将标签应用于每封电子邮件(例如,公众,业务敏感,内部)。
我没有让用户在每本电子邮件中弹出25次标签,而是试图以编程方式应用它。
我获得了错误代码(-1248837627)。
我的解决方案是获取标签GUID,然后将其应用于以下电子邮件。我遇到了其他解决方案,例如使用SendKeys,但我更喜欢它是最后的度假胜地。
With olMail
.To = olSendTo
.Subject = olSubject
.PermissionTemplateGuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX"
.Permission = olPermissionTemplate
'And so on, the email function works great until the above two lines are added
我是否应用.permissions
或.permissionTemplateguid
不正确?
我已经看到了类似的方法,可以将标签应用于Excel文档(抓取并设置GUID)。
I have a VBA function in our MS Access database that generates Outlook emails and sends them from a shared inbox.
Our company uses Azure Information Protection to protect documents. A label needs to be applied to each email before it is sent (e.g. Public, Business Sensitive, Internal).
Rather than having the user click the label 25 times as it pops up for each email, I am trying to apply it programmatically.
I get error code (-1248837627).
My solution was to grab the labels GUID and then apply it to the email as below. I came across other solutions such as using SendKeys but I prefer it to be a last resort.
With olMail
.To = olSendTo
.Subject = olSubject
.PermissionTemplateGuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX"
.Permission = olPermissionTemplate
'And so on, the email function works great until the above two lines are added
Am I applying the .Permissions
or .PermissionTemplateGUID
improperly?
I have seen a similar approach to apply labels to Excel documents (grabbing and setting the guid).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您发布的代码用于指定信息权限管理 (IRM) 权限。 Azure 信息保护是另一回事。
您需要按以下格式添加用户属性:
但我建议使用 MFCMAPI< 探索 Outlook 邮件项目的内部结构/a> 或
OutlookSpy
查找确切的解决方案。尝试手动设置它,然后使用这些工具探索内部结构。The code you posted is used to specify Information Rights Management (IRM) permissions. Azure Information Protection is another story.
You need to add a user property in the following format:
But I'd suggest exploring internals of Outlook mail items using MFCMAPI or
OutlookSpy
to find the exact solution. Try to set it manually then explore internals using these tools.