返回 Boolean 类型的值,该值确定当前网页是否为孤立的。孤立网页是指不能通过超链接从主页进行访问的网页。只读。
expression.IsOrphan
expression 必选。返回“应用于”列表中的对象之一的表达式。
如果为 True,则网页不能从主页进行访问。如果为 False,则网页可以从主页进行访问。
下列示例在当前站点中搜索,并显示所有孤立文件的文件名。孤立文件由其 IsOrphan 属性表示。一旦发现 IsOrphan 属性等于 True 的文件,则将其 Label 属性添加到一个 String 类型的值中,该值包含站点中所有孤立节点的名称。然后,向用户显示这个存储在变量 strName 中的 String 值。如果站点中没有找到孤立节点,则向用户显示一条消息。
Sub ListOrphans()
'Displays the names of orphan files.
Dim objApp As FrontPage.Application
Dim objWebFile As WebFile
Dim strName As String
Dim blnFound As Boolean
Set objApp = FrontPage.Application
blnFound = False
'For each file in the web
For Each objWebFile In ActiveWeb.AllFiles
'Check if the file is an orpahn
If objWebFile.IsOrphan Then
blnFound = True
If strName = "" Then
strName = strName & objWebFile.Name
Else
'otherwise add next node label to string
strName = strName & ", " & vbCr & objWebFile.Name
End If
End If
Next
If blnFound = True Then
'Display names of all orphan pages
MsgBox "The orphan pages in the current web are: " & vbCr & vbCr & _
strName & "."
Else
'No orphans, display message
MsgBox "There are no orphan pages in the web."
End If
End Sub