HeaderSourceName Property Example

If a header source is attached to the active document, this example displays the file name.

hName = ActiveDocument.MailMerge.DataSource.HeaderSourceName
If hName <> "" Then MsgBox hName

This example opens the header source attached to the active document if the source is a Word document.

Set dSource = ActiveDocument.MailMerge.DataSource
If dSource.HeaderSourceType = wdMergeInfoFromWord Then
    Documents.Open FileName:=dSource.HeaderSourceName
End If