Parent 属性

       

返回指定对象的 Parent 对象的名称。

expression.Parent

expression  必选。返回“应用于”列表中的对象之一的表达式。

说明

指定 WebFile 对象的 Parent 属性可以返回 WebFolder 对象。当对象包含在站点中时,Parent 属性返回 WebEx 对象。例如,如果 Theme 对象包含在称为“Adventure Works Web”的 WebEx 对象中,则 Parent 属性将返回“Adventure Works Web”;而对于从 WebEx 对象外部引用的主题,Parent 属性将返回 Application 对象的名称,在这种情况下,将返回“Microsoft FrontPage”。但是,当客户端计算机指定了 System 对象时,Parent 属性将返回主机的 Application 对象,而不是客户端的 Application 对象。

下列表格描述了为不同对象类型返回的值。

对象 说明
MetaTags 返回 META 标记的 WebFile 对象。
NavigationNode RootNavigationNode 对象以外,返回父 NavigationNode 对象,RootNavigationNode 对象的父对象为 WebEx
NavigationNodes 根据导航结构,返回导航节点集合的父 NavigationNode 对象。
PageWindowEx 返回网页所在的 WebWindowExApplication 对象。
PageWindows 返回包含集合的 Application 对象。
Properties 从 META 标记信息返回 WebExWebFileWebFolder 对象。
System 返回 Application 对象。
Theme 返回主题的父 WebExWebFile 对象。
Themes 返回包含集合的 WebEx 对象。
WebEx 返回 Application 对象。
WebFile 返回 WebFolder 对象。
WebFiles 返回父 WebFolder 对象。
WebFolder 返回父 WebFolder 对象(如果为子文件夹),如果为根文件夹则返回 WebEx 对象。
WebFolders 返回包含集合的 WebFolder 对象。
Webs 返回 Application 对象。
WebWindowEx 返回包含指定对象的 Application 对象。
WebWindows 返回包含集合的 Application 对象。

示例

在本示例中,myParent 返回基于 FrontPage 的活动站点的父应用程序的文件类型和 build 号。

Private Sub GetParentInfo()
    Dim myWeb As WebEx
    Dim myParent As String
    Dim myParentBuild As String

    Set myWeb = Application.ActiveWeb

    With myWeb
        myParent = .Parent.FileSearch.FileType
        myParentBuild = .Parent.Build
    End With
End Sub