מאקרו להסיר כותרות עליונות ולקשורכל הכותרות העליונות זה לזה (מבטל את הביטול "קשר עם הקודם" בכל המסמך ומשאיר כותרת עליונה נקיה)
Sub ResetAndLinkAllHeaders()
Dim doc As Document
Dim i As Long, j As Long
Dim h As Variant
Dim hdr As HeaderFooter
Set doc = ActiveDocument
Application.ScreenUpdating = False
' Connect all headers to previous sections
For i = 2 To doc.Sections.Count
For Each h In Array(wdHeaderFooterPrimary, _
wdHeaderFooterFirstPage, _
wdHeaderFooterEvenPages)
doc.Sections(i).Headers(CLng(h)).LinkToPrevious = True
Next h
Next i
' Delete all header content from first section
For Each h In Array(wdHeaderFooterPrimary, _
wdHeaderFooterFirstPage, _
wdHeaderFooterEvenPages)
Set hdr = doc.Sections(1).Headers(CLng(h))
' Remove floating shapes and decorations
For j = hdr.Shapes.Count To 1 Step -1
hdr.Shapes(j).Delete
Next j
' Remove text and inline content
hdr.Range.Delete
Next h
Application.ScreenUpdating = True
MsgBox "All headers cleared and linked successfully."
End Sub