PropertyCaptionFont Property

Microsoft Office Web Components Object Model

PropertyCaptionFont Property

       

Returns a PivotFont object that represents the font settings used to display the caption of OLAP member properties in the specified view. Use the returned object to format the font used for member property captions.

expression.PropertyCaptionFont

expression   Required. An expression that returns a PivotView object.

Example

This example formats the alignment and the font of member property captions and values in the active view of PivotTable1.

Sub Format_MemberProperties()

    Dim ptView
    Dim ptConstants

    Set ptConstants = PivotTable1.Constants

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

    ' The following three lines of code format the
    ' font for member property captions.
    ptView.PropertyCaptionFont.Name = "Tahoma"
    ptView.PropertyCaptionFont.Size = 8
    ptview.PropertyCaptionFont.Bold = True

    ' Left-align the member property captions.
    ptview.PropertyCaptionHAlignment = ptConstants.plHAlignLeft

    ' The following two lines of code format the
    ' font for member property values.
    ptview.PropertyValueFont.Name = "Tahoma"
    ptview.PropertyValueFont.Size = 8

    ' Right-align the member property values.
    ptview.PropertyValueHAlignment = ptConstants.plHAlignRight

End Sub