DEV Community

Query Filter
Query Filter

Posted on

docker2

Sub MoveHeaderToBody()
    Dim sec As Section
    For Each sec In ActiveDocument.Sections
        ' Copy Header content
        sec.Headers(wdHeaderFooterPrimary).Range.Cut
        ' Move to the end of the main document body and paste
        ActiveDocument.Range(ActiveDocument.Content.End - 1).Paste

        ' Copy Footer content
        sec.Footers(wdHeaderFooterPrimary).Range.Cut
        ActiveDocument.Range(ActiveDocument.Content.End - 1).Paste
    Next sec
End Sub
Enter fullscreen mode Exit fullscreen mode

Top comments (0)