我试图将一个“从帐户”条件添加到由VBA创建的一组Outlook规则。该帐户的显示名称是:[email protected],ACCOUNTTYPE是:0和Class是:105如何处理Outlook中的帐户条件属性规则VBA
Dim oAccountRuleConditionSubscribe As Outlook.AccountRuleCondition
Dim oRuleNew As Outlook.Rule
Set oAccountRuleConditionSubscribe = oRuleNew.Conditions.Account
With oAccountRuleConditionSubscribe
.Enabled = True
.Account.DisplayName = [email protected]
End With
以上是我能想出,仍然不会采取ABCD @ ABCD最新.com作为有效的帐户参考。我已经用尽了所有的教程,术语表和MSDN资源,我真的很感谢你的帮助。
我发现了一个解决办法,由于尤金,有:
Dim oAccountRuleConditionSubscribe As Outlook.AccountRuleCondition
Dim oRuleNew As Outlook.Rule
Dim OutApp As Outlook.Application
Set OutApp = CreateObject("Outlook.Application")
Set oAccountRuleConditionSubscribe = oRuleNew.Conditions.Account
With oAccountRuleConditionSubscribe
.Enabled = True
.Account = OutApp.Session.Accounts.item(2)
End With
但我仍然在努力通过其displayName OT identigy的帐户。
任何指针?
您需要在哪里确定帐户?你究竟需要实现什么?您似乎需要从Accounts集合中选择具有指定电子邮件地址的帐户,然后将其设置为规则条件。我对吗? – 2015-02-13 09:07:07
是的,你是对的。我想选择它使用DisplayName,而不是项目(#)。 – clippertm 2015-02-16 00:33:36
但我仍然在通过其DisplayName来识别账户。 - 你到底在找什么? – 2015-02-16 14:05:25