![]() |
|
#4
|
|||
|
|||
|
In your document template, create a building block entry of the Primary Page Header content (minus the final paragraph mark). Name it "HPP"
Create a building block entry of the Even Page Header content (minus the final paragraph mark). Name it "HEP" Run this macro: Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oHF As HeaderFooter
Dim oRng As Range
For Each oHF In ActiveDocument.Sections(1).Headers
Set oRng = oHF.Range
Select Case oHF.Index
Case wdHeaderFooterPrimary
oRng.Text = vbNullString
oRng.Collapse wdCollapseStart
ActiveDocument.AttachedTemplate.BuildingBlockEntries("HPP").Insert oRng
Case wdHeaderFooterEvenPages
oRng.Text = vbNullString
oRng.Collapse wdCollapseStart
ActiveDocument.AttachedTemplate.BuildingBlockEntries("HEP").Insert oRng
End Select
Next
lbl_Exit:
Exit Sub
End Sub
|
| Tags |
| header numbers, header page numbering, header template |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Problem with page number header
|
webgal318 | Word | 4 | 06-22-2020 06:40 PM |
| Don't want page number or date in footer on first page, do want graphic in header. | dianahbr | Word | 2 | 02-23-2018 09:25 AM |
Header and page number
|
rimutaka | Word | 4 | 06-01-2016 08:30 PM |
Change page number in header on page x of y - y has too many pages
|
wpryan | Word VBA | 3 | 07-17-2015 07:04 AM |
Header and page number
|
atitool | Word | 1 | 11-06-2014 06:42 AM |