HeadersFooters.Item Method (Word)

Returns a HeaderFooter object that represents a header or footer in a range or section.

Syntax

expression .Item(Index)

expression Required. A variable that represents a HeadersFooters collection.

Parameters

Name

Required/Optional

Data Type

Description

Index

Required

WdHeaderFooterIndex

A constant that specifies the header or footer in the range or section.

Return Value

HeaderFooter

Example

This example creates and formats a first page header in the active document.

Sub HeadFootItem() 
 ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True 
 With ActiveDocument.Sections(1).Headers _ 
 .Item(wdHeaderFooterFirstPage).Range 
 .InsertBefore "Sales Report" 
 With .Font 
 .Bold = True 
 .Size = "15" 
 .Color = wdColorBlue 
 End With 
 .Paragraphs.Alignment = wdAlignParagraphCenter 
 End With 
End Sub

See Also

Concepts

HeadersFooters Collection Object

HeadersFooters Object Members