Word is not recognizing my header, therefore, I cannot delete it. RRS feed

  • Question

  • I have a document that was converted from either WordPerfect or PDF. It has a blank header that I can see, but that Word is not recognizing. This header is screwing up the formatting of my document. How can I delete it?
    Friday, May 20, 2016 1:46 PM


  • Hi This Stinks,

    First I want to confirm with you that are you trying to remove footer using VBA or using manually by user interface.

    if you are trying to remove the Header using the VBA code then please use the code below.

    Sub RemoveHeader()
        Dim oSec As Section
        Dim oHead As HeaderFooter
        For Each oSec In ActiveDocument.Sections
            For Each oHead In oSec.Headers
                If oHead.Exists Then oHead.Range.Delete
            Next oHead
        Next oSec
    End Sub

    but it will delete the contents of Header and make it blank. you can't remove the Headers from the Document. as you have already mentioned that Headers are blank and it is spoiling your formatting of the document. so here I recommend you to decrease the size of that your formatting looks in proper way.

    to decrease the size of Header please use the code below.

    Sub Macro3()
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        With ActiveDocument.PageSetup
            .TopMargin = InchesToPoints(0.5)
            .HeaderDistance = InchesToPoints(0.5)
        End With
    End Sub

    if you are trying to do this operation from user interface then please let us know. we will move this thread to related Forum.



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 23, 2016 12:47 AM