我不知道这是否可行,但我想在电子邮件的收件人中插入来自群组邮箱地址簿的联系人部分的条目。我设法找到了使用以下代码在单独的对话框中显示联系人列表的代码:
Sub ShowSharedMailboxContacts()
Dim objNS As Outlook.NameSpace
Dim objRecip As Outlook.Recipient
Dim objFolder As Outlook.Folder
' Access the Outlook namespace
Set objNS = Application.GetNamespace("MAPI")
' Replace "[email protected]" with the shared mailbox email address
Set objRecip = objNS.CreateRecipient("[email protected]")
objRecip.Resolve
If objRecip.Resolved Then
' Access the contacts folder of the shared mailbox
Set objFolder = objNS.GetSharedDefaultFolder(objRecip, olFolderContacts)
objFolder.Display
Else
MsgBox "Unable to resolve recipient."
End If
' Clean up objects
Set objNS = Nothing
Set objRecip = Nothing
Set objFolder = Nothing
End Sub
甚至将地址簿显示To
为联系人也是一种改进。
任何帮助将不胜感激。