With ActiveWindow.ActivePane.View
.Type = wdPageView
.SeekView = wdSeekCurrentPageHeader
End With
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View _
.SeekView = wdSeekCurrentPageFooter
End If
Selection.HeaderFooter.PageNumbers.Add