本文介绍了Outlook使用GetSharedDefaultFolder在SharedMailbox中选择一个子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在尝试选择 SharedMailbox 中的子文件夹时遇到了麻烦.
我已经阅读了GetSharedDefaultFolder
上的许多资源.
但是,努力将其正确放置.
如果您可以提供帮助,那将是非常不错的.
I am having trouble trying to select a subfolder in SharedMailbox.
I have read a number of resources on GetSharedDefaultFolder
.
However, struggling to put it together correctly.
Would be really great if you could help with this.
Sub ListOutlookEmailInfoInExcel()
Dim olNS As Outlook.NameSpace
Dim olTaskfolder As Outlook.MAPIFolder
Dim olTask As Outlook.TaskItem
Dim olItems As Outlook.Items
Set o1NS = GetNamespace("MAPI")
Set o1TaskFolder = o1NS.GetSharedDefaultFolder("Shared Folder 1", _
olFolderInbox).Folders("admin")
Set o1Items = o1TaskFolder.Items
End Sub
推荐答案
您首先按照此处所述 http://www.slipstick.com/developer/working-vba-nondefault-outlook-folders/
在解析收件人时,可以使用邮箱所有者的显示名称,别名或电子邮件地址."
"You can use the mailbox owner's display name, alias, or email address when resolving the recipient."
Sub ListOutlookEmailInfoInExcel()
Dim olNS As Outlook.NameSpace
Dim olTaskfolder As Outlook.MAPIFolder
Dim olTask As Outlook.TaskItem
Dim olItems As Outlook.Items
Dim objOwner As Outlook.Recipient
Set olNS = GetNamespace("MAPI")
Set objOwner = olNS.CreateRecipient("Shared Folder 1")
objOwner.Resolve
If objOwner.Resolved Then
Set olTaskFolder = olNS.GetSharedDefaultFolder(objOwner, _
olFolderInbox).Folders("admin")
Set olItems = olTaskFolder.Items
End If
End Sub
这篇关于Outlook使用GetSharedDefaultFolder在SharedMailbox中选择一个子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!