Class HeaderFooter (PowerPoint VBA)

The class HeaderFooter represents a header, footer, date and time, slide number, or page number on a slide or master. All the HeaderFooter objects for a slide or master are contained in a HeadersFooters object.


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

Dim hfr as HeaderFooter
Set hfr = ActivePresentation.SlideMaster.HeadersFooters.DateAndTime

The following procedures can be used to set variables of type HeaderFooter: HeadersFooters.DateAndTime, HeadersFooters.Footer, HeadersFooters.Header and HeadersFooters.SlideNumber


Returns or sets the format for the automatically updated date and time.

Possible Values are ppDateTimeddddMMMMddyyyy - ddddMMMMddyyyy, ppDateTimedMMMMyyyy - dMMMMyyyy, ppDateTimedMMMyy - dMMMyy, ppDateTimeFigureOut - Figure Out, ppDateTimeFormatMixed - Mixed Format, ppDateTimeHmm - Hmm, ppDateTimehmmAMPM - hmmAMPM, ppDateTimeHmmss - Hmmss, ppDateTimehmmssAMPM - hmmssAMPM, ppDateTimeMdyy - Mdyy, ppDateTimeMMddyyHmm - MMddyyHmm, ppDateTimeMMddyyhmmAMPM - MMddyyhmmAMPM, ppDateTimeMMMMdyyyy - MMMMdyyyy, ppDateTimeMMMMyy - MMMMyy, ppDateTimeMMyy - MMyy, ppDateTimeUAQ1, ppDateTimeUAQ2, ppDateTimeUAQ3, ppDateTimeUAQ4, ppDateTimeUAQ5, ppDateTimeUAQ6, ppDateTimeUAQ7.

The Format property applies only to HeaderFooter objects that represent a date and time (returned from the HeadersFooters collection by the DateAndTime property). Make sure that the date and time are set to be updated automatically (not displayed as fixed text) by setting the UseFormat property to True. The Format property value can be one of these PpDateTimeFormat constants.

ActiveWindow.Selection.SlideRange(1).HeadersFooters.DateAndTime.Format = ppDateTimeddddMMMMddyyyy


Returns the parent object for the specified object.


Returns or sets a String that represents the text contained in the specified object.

ActivePresentation.SlideMaster.HeadersFooters.DateAndTime.Text =


Determines whether the date and time object contains automatically updated information.

This property applies only to a HeaderFooter object that represents a date and time (returned by the DateAndTime property). Set the UseFormat property of a date and time HeaderFooter object to True when you want to set or return the date and time format by using the Format property. Set the UseFormat property to msoFalse when you want to set or return the text string for the fixed date and time. The value of the UseFormat property can be one of these MsoTriState constants.

ActiveWindow.Selection.SlideRange(1).HeadersFooters.DateAndTime.UseFormat = msoTrue


Returns or sets the visibility of the specified object or the formatting applied to the specified object.

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

ActivePresentation.SlideMaster.HeadersFooters.DateAndTime.Visible = msoTrue