Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 1.01 KB

Word.Selection.HeaderFooter.md

File metadata and controls

51 lines (31 loc) · 1.01 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Selection.HeaderFooter property (Word)
vbawd10.chm158662962
vbawd10.chm158662962
Word.Selection.HeaderFooter
b2eeeb83-49bf-236e-e795-6231ff20e368
06/08/2017
medium

Selection.HeaderFooter property (Word)

Returns a HeaderFooter object for the specified selection. Read-only.

Syntax

expression. HeaderFooter

expression A variable that represents a Selection object.

Remarks

An error occurs if the selection isn't located within a header or footer.

Example

This example adds a centered page number to the current page footer.

With ActiveDocument.ActiveWindow.View 
 .Type = wdPrintView 
 .SeekView = wdSeekCurrentPageFooter 
End With 
Selection.HeaderFooter.PageNumbers.Add _ 
 PageNumberAlignment:=wdAlignPageNumberCenter

See also

Selection Object

[!includeSupport and feedback]