我試圖將一個「從帳戶」條件添加到由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