HeaderFont Property

Microsoft Office Web Components Object Model

HeaderFont Property

       

Returns a P ivotFont object representing the font for the headings in the data area or an item in the filter area of the specified view.

expression.HeaderFont

expression   Required. An expression that returns a PivotView object.

Remarks

Use the HeaderBackColor, HeaderForeColor, and HeaderHAlignment properties to in addition to this property to format the heading in the data area or an item in the filter area of a PivotTable list.

Example

This example formats the header for the data area and the filter area of the current view in PivotTable1.

Sub SetHeaderProperties()

    Dim ptView
    Dim ptConstants

    Set ptConstants = PivotTable1.Constants

    ' Set a variable to the current PivotTable view.
    Set ptView = PivotTable1.ActiveView

    ' Set the background color.
    ptView.HeaderBackColor = "Gray"

    ' Set the foreground color.
    ptView.HeaderForeColor = "Blue"

    ' Set the font.
    ptView.HeaderFont = "Tahoma"

    ' Set the alignment.
    ptView.HeaderHAlignment = ptConstants.plHAlignLeft

End Sub