Class HeadersFooters (PowerPoint VBA)

Contains all the HeaderFooter objects on the specified slide, notes page, handout, or master.

Set

To use a HeadersFooters class variable it first needs to be instantiated, for example

Dim hfs as HeadersFooters
Set hfs = ActivePresentation.SlideMaster.HeadersFooters

The following procedures can be used to set variables of type HeadersFooters: CustomLayout.HeadersFooters, Master.HeadersFooters, Slide.HeadersFooters and SlideRange.HeadersFooters

Clear

Clears the header and footer from the specified slide or slides.

ActivePresentation.SlideMaster.HeadersFooters.Clear

DateAndTime

Returns a HeaderFooter object that represents the date and time item that appears in the lower-left corner of a slide or in the upper-right corner of a notes page, handout, or outline.

Dim hfrDateAndTime As HeaderFooter
Set hfrDateAndTime = ActiveWindow.Selection.SlideRange(1).HeadersFooters.DateAndTime

DisplayOnTitleSlide

Determines whether the footer, date and time, and slide number appear on the title slide. Applies to slide masters.

The value of the DisplayOnTitleSlide property can be one of these MsoTriState constants.

ActiveWindow.Selection.SlideRange(1).HeadersFooters.DisplayOnTitleSlide = msoTrue

Footer

Returns a HeaderFooter object that represents the footer that appears at the bottom of a slide or in the lower-left corner of a notes page, handout, or outline.

Dim hfrFooter As HeaderFooter
Set hfrFooter = ActiveWindow.Selection.SlideRange(1).HeadersFooters.Footer

Header

Returns a HeaderFooter object that represents the header that appears at the top of a slide or in the upper-left corner of a notes page, handout, or outline.

Dim hfrHeader As HeaderFooter
Set hfrHeader = ActiveWindow.Selection.SlideRange(1).HeadersFooters.Header

Parent

Returns the parent object for the specified object.

SlideNumber

Returns a HeaderFooter object that represents the slide number in the lower-right corner of a slide, or the page number in the lower-right corner of a notes page or a page of a printed handout or outline.

Dim hfrSlideNumber As HeaderFooter
Set hfrSlideNumber = ActiveWindow.Selection.SlideRange(1).HeadersFooters.SlideNumber