The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HeaderFooter Object

Office 2007
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.


Use one of the properties listed in the following table to return the HeaderFooter object.

Use this propertyTo return
DateAndTimeA HeaderFooter object that represents the date and time on the slide.
FooterA HeaderFooter object that represents the footer for the slide.
HeaderA HeaderFooter object that represents the header for the slide. This works only for notes pages and handouts, not for slides.
SlideNumberA HeaderFooter object that represent the slide number (on a slide) or page number (on a notes page or a handout).
Bb265521.vs_note(en-us,office.12).gif  Note
HeaderFooter objects aren't available for Slide objects that represent notes pages. The HeaderFooter object that represents a header is available only for a notes master or handout master.


You can set properties of HeaderFooter objects for single slides. The following example sets the footer text for slide one in the active presentation.

Visual Basic for Applications
ActivePresentation.Slides(1).HeadersFooters.Footer.Text = "Volcano Coffee"

You can also set properties of HeaderFooter objects for the slide master, title master, notes master, or handout master to affect all slides, title slides, notes pages, or handouts and outlines at the same time. The following example sets the text for the footer in the slide master for the active presentation, sets the format for the date and time, and turns on the display of slide numbers. These settings will apply to all slides that are based on this master that display master graphics and that have not had their footer and date and time set individually.

Visual Basic for Applications
Set mySlidesHF = ActivePresentation.SlideMaster.HeadersFooters
With mySlidesHF
    .Footer.Visible = True
    .Footer.Text = "Regional Sales"
    .SlideNumber.Visible = True
    .DateAndTime.Visible = True
    .DateAndTime.UseFormat = True
    .DateAndTime.Format = ppDateTimeMdyy
End With

To clear header and footer information that has been set for individual slides and make sure all slides display the header and information you define for the slide master, run the following code before running the previous example.

Visual Basic for Applications
For Each s In ActivePresentation.Slides
    s.DisplayMasterShapes = True

Community Additions