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

Format

Returns or sets the format for the automatically updated date and time. Here you can find possible values for PpDateTimeFormat.

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

Text

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


ActivePresentation.SlideMaster.HeadersFooters.DateAndTime.Text =

UseFormat

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

Visible

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