Outlook) (Recipients.ResolveAll 方法
嘗試針對通訊錄解析Recipients集合中的所有Recipient物件。
語法
expression。 ResolveAll
表達 代表 Recipients 物件的 變數。
傳回值
如果所有的物件都已經解析,會為 True,如果有一個或多個物件未解析,則回 False。
範例
這個 Visual Basic for Applications (VBA) 範例會使用 ResolveAll 方法來嘗試解析所有收件者,如果失敗,則會顯示每個無法解析收件者的訊息方塊。
Sub CheckRecipients()
Dim MyItem As Outlook.MailItem
Dim myRecipients As Outlook.Recipients
Dim myRecipient As Outlook.Recipient
Set myItem = Application.CreateItem(olMailItem)
Set myRecipients = myItem.Recipients
myRecipients.Add("Aaron Con")
myRecipients.Add("Nate Sun")
myRecipients.Add("Dan Wilson")
If Not myRecipients.ResolveAll Then
For Each myRecipient In myRecipients
If Not myRecipient.Resolved Then
MsgBox myRecipient.Name
End If
Next
End If
End Sub
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。