且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Outlook字段和等效属性

更新时间:2023-09-03 15:40:28

您可以使用MailItem的UserProperties.

You can utilize the UserProperties of the MailItem.

例如OutlookMail.UserProperties("Oper").Value将返回您创建的属性字段的值.

For example OutlookMail.UserProperties("Oper").Value will return the value of that property field you created.

请注意,如果该字段未填充,将导致错误,因此建议您预先使用Find进行IF检查,以确保不会引发异常.

Note that it WILL cause an error it that field is not populated so it is suggested to use Find beforehand with an IF check to ensure you don't throw an exception.

If Not(OutlookMail.UserProperties.Find("Oper", True) Is Nothing) Then
    'Do stuff with OutlookMail.UserProperties("Oper").Value
End If