For Each s In ActiveDocument.Sections
With s.Headers(wdHeaderFooterPrimary)
.LinkToPrevious = False
If s.PageSetup.Orientation = wdOrientLandscape Then
NormalTemplate.AutoTextEntries("横用H").Insert where:=.Range
Else
NormalTemplate.AutoTextEntries("縦用H").Insert where:=.Range
End If
End With
Next