IsOrphan Property
True indicates that the file cannot be reached by hyperlink from any page in the Web site. Read-only.
expression.IsOrphan
expression Required. An expression that returns a WebFile object.
Example
The following example searches through the current Web site and displays the names of all orphan files. An orphan file is denoted by its IsOrphan property. Once a file is found with an IsOrphan property that equals True, the Label property value is added to a String containing the names of all orphan nodes in the Web site. The names of the orphan files, stored in the String variable strName, are then displayed to the user. If no orphan files are found in the Web site, a message is displayed to the user.
Sub ListOrphans()
'Displays the names of orphan files.
Dim objApp As FrontPage.Application
Dim objWebFile As WebFile
Dim strName As String
Set objApp = FrontPage.Application
'For each file in the Web site site
For Each objWebFile In ActiveWeb.AllFiles
'Check if the file is an orpahn
If objWebFile.IsOrphan Then
strName = strName & objWebFile.Name & " | "
End If
Next
If strName <> "" Then
'Display names of all orphan pages
MsgBox "The orphan pages in the current Web site are: " & vbCr & vbCr & _
strName & "."
Else
'No orphans, display message
MsgBox "There are no orphan pages in the Web site."
End If
End Sub