![]() |
#2
|
||||
|
||||
![]()
The first page header will exist, even if empty, provided the different first page option is applied to the current section. I suspect what you want is to ensure the first page header has no content. In that case simply deleting the content of the header will achieve the aim of having an empty header e.g. as follows. I have added optional code to show if the header is empty.
Code:
Sub ClearHeader() Dim secTemp As Section Dim sectionNum As Integer Dim oHeader As HeaderFooter sectionNum = Selection.Information(wdActiveEndSectionNumber) Set secTemp = ActiveDocument.Sections(sectionNum) If secTemp.Headers(wdHeaderFooterFirstPage).Exists = True Then Set oHeader = secTemp.Headers(wdHeaderFooterFirstPage) If Len(oHeader.Range) > 1 Then 'Optional oHeader.Range.Delete Else 'optional MsgBox "Header is empty" 'optional End If 'Optional End If End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
headers, heading 1, section breaks |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Nathan8752 | Word | 3 | 08-31-2015 12:41 PM |
![]() |
Huffle | Word | 2 | 09-28-2014 03:48 PM |
include heading text in header | eNGiNe | Word | 2 | 03-06-2013 12:24 AM |
How to have a heading 1 file automatically appear in each header of any page? | expert4knowledge | Word | 2 | 09-16-2012 10:38 AM |
![]() |
Kanith | Word | 1 | 06-14-2011 03:35 PM |