HeadersFooters.Item Method

Word Developer Reference

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.

Visual Basic for Applications
  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