Upravit

Sdílet prostřednictvím


View.NextHeaderFooter method (Word)

Moves to the next header or footer, depending on whether a header or footer is displayed in the view.

Syntax

expression. NextHeaderFooter

expression Required. A variable that represents a 'View' object.

Remarks

If the view displays a header, this method moves to the next header within the current section (for example, from an odd header to an even header) or to the first header in the following section. If the view displays a footer, this method moves to the next footer.

Note

If the view displays the last header or footer in the last section of the document, or if it is not displaying a header or footer at all, an error occurs.

Example

This example displays the first page header in the active document and then switches to the next header. The document needs to be at least two pages long.

ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True 
With ActiveDocument.ActiveWindow.View 
 .Type = wdPrintView 
 .SeekView =wdSeekFirstPageHeader 
 .NextHeaderFooter 
End With

See also

View Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.