操作失败错误引用Outlook.MAPIFolder

时间:2017-11-25 15:50:50

标签: vba excel-vba excel

我在共享的Outlook子文件夹中引用约会项目(在日历项目下)。它适用于我,但不适用于我组织中的其他人。这是代码:

Public Sub SyncFlightCals()
Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.Namespace
Dim myRecipient As Outlook.Recipient
Dim CalendarFolder As Outlook.MAPIFolder

Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("N154WA")
myRecipient.Resolve
If myRecipient.Resolved Then
    Set CalendarFolder = myNamespace.GetSharedDefaultFolder(myRecipient, olFolderCalendar)
    Set CalendarFolder = CalendarFolder.Folders("SWF>VVS Shuttles") ''<<ERRORS ON THIS LINE
End if

起初我以为是因为并非所有用户都可以访问该文件夹;只有日历子文件夹名为&#34; SWF&gt; VVS Shuttles&#34;但它之前适用于他们。任何提示?

0 个答案:

没有答案