命名空间 OpenSharedFolder 方法 (Outlook)NameSpace.OpenSharedFolder method (Outlook)

打开一个通过 URL 或文件名引用的共享文件夹。Opens a shared folder referenced through a URL or file name.

语法Syntax

expressionexpression. OpenSharedFolder( _Path_ , _Name_ , _DownloadAttachments_ , _UseTTL_ )

_表达式_一个返回NameSpace对象的表达式。expression An expression that returns a NameSpace object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
路径Path 必需Required StringString 要打开的共享文件夹的 URL 或本地文件名。The URL or local file name of the shared folder to be opened.
NameName 可选Optional VariantVariant 真正简单的整合 (RSS) 源或 Webcal 日历的名称。The name of the Really Simple Syndication (RSS) feed or Webcal calendar. 对于其他共享文件夹类型,忽略此参数。This parameter is ignored for other shared folder types.
DownloadAttachmentsDownloadAttachments 可选Optional VariantVariant 指示是否下载 RSS 源或 Webcal 日历附件。对于其他共享文件夹类型,忽略此参数。Indicates whether to download enclosures (for RSS feeds) or attachments (for Webcal calendars.) This parameter is ignored for other shared folder types.
UseTTLUseTTL 可选Optional VariantVariant 指示是否应使用 RSS 源或 WebCal 日历中的生存时间 (TTL) 设置。Indicates whether the Time To Live (TTL) setting in an RSS feed or WebCal calendar should be used. 对于其他共享文件夹类型,忽略此参数。This parameter is ignored for other shared folder types.

返回值Return value

一个代表共享文件夹的**folder** 对象。A Folder object that represents the shared folder.

说明Remarks

此方法用于访问下列共享文件夹类型:This method is used to access the following shared folder types:

  • Webcal 日历 (webcal://的 "我的" " / 的"mycalendarWebcal calendars (webcal:// mysite / mycalendar )

  • RSS 源 (feed://的 " / 的所有"myfeed )RSS feeds (feed:// mysite / myfeed )

  • Microsoft SharePoint Foundation 文件夹 (stssync://的 " / 的所有"myfolder )Microsoft SharePoint Foundation folders (stssync:// mysite / myfolder )

  • iCalendar 日历 (.ics) 文件iCalendar calendar (.ics) files

  • vCard 联系人 (.vcf) 文件vCard contact (.vcf) files

  • Outlook 邮件 (.msg) 文件Outlook message (.msg) files

备注

[!注释] 此方法不支持 iCalendar 约会 (.ics) 文件。This method does not support iCalendar appointment (.ics) files. 若要打开 iCalendar 约会文件, 可以使用**NameSpace** 对象的**OpenSharedItem** 方法。To open iCalendar appointment files, you can use the OpenSharedItem method of the NameSpace object.

您可以使用Namespace对象的**GetSharedDefaultFolder** 方法在 Exchange 中共享默认文件夹, 如 "收件箱" 文件夹。You can use the GetSharedDefaultFolder method of the Namespace object to share default folders, such as the Inbox folder, in Exchange.

示例Example

以下 Visual Basic for Applications (VBA) 示例打开并显示 Webcal 日历。The following Visual Basic for Applications (VBA) example opens and displays a Webcal calendar.

Public Sub OpenSharedHolidayCalendar() 
 
 
 
 Dim oNamespace As NameSpace 
 
 Dim oFolder As Folder 
 
 
 
 On Error GoTo ErrRoutine 
 
 
 
 Set oNamespace = Application.GetNamespace("MAPI") 
 
 Set oFolder = oNamespace.OpenSharedFolder( _ 
 
 "webcal://icalx.com/public/icalshare/US32Holidays.ics") 
 
 oFolder.Display 
 
 
 
EndRoutine: 
 
 On Error GoTo 0 
 
 Set oFolder = Nothing 
 
 Set oNamespace = Nothing 
 
Exit Sub 
 
 
 
ErrRoutine: 
 
 MsgBox Err.Description, vbOKOnly, Err.Number & " - " & Err.Source 
 
 GoTo EndRoutine 
 
End Sub

另请参阅See also

命名空间对象NameSpace Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.