HasFile Property Example

This example displays the file name of each subdocument in the active document. The example also displays a message for each subdocument that hasn't been saved.

For Each subdoc In ActiveDocument.Subdocuments
    subdoc.Range.Select
    If subdoc.HasFile = True Then
        MsgBox subdoc.Path & Application.PathSeparator _
            & subdoc.Name
    Else
        MsgBox "This subdocument has not been saved."
    End If
Next subdoc