计算共享收件箱中的子文件夹

时间:2019-05-10 12:00:01

标签: access-vba

我需要计算共享收件箱中的子文件夹,但是代码没有看到任何子文件夹,尽管其中有6个。任何帮助将非常感激。该代码在MS Access中。谢谢。

当前代码如下:

    Private Sub Command0_Click()

        Dim myOlApp As Outlook.Application
        Set myOlApp = CreateObject("Outlook.Application")


        Dim NS As Outlook.NameSpace
        Set NS = myOlApp.GetNamespace("MAPI")

        Dim objOwner As Outlook.Recipient
        Set objOwner = NS.CreateRecipient("FINFF")  '"FINFF" is alias of shared inbox
        objOwner.Resolve

        If objOwner.Resolved Then
            MsgBox objOwner.Name
        End If

        Dim olFolder As Outlook.Folder
        Set olFolder = NS.GetSharedDefaultFolder(objOwner, olFolderInbox)

        MsgBox olFolder.Folders.Count

   End Sub

0 个答案:

没有答案