ShowAsPercentage Property

Microsoft FrontPage Visual Basic

ShowAsPercentage Property

Returns or sets a Boolean that determines if the value in the field will be displayed as a percentage. Read/write.

expression.ShowAsPercentage

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

The following example sets the ShowAsPercentage property of all fields of type fpFieldNumber to True. The values in the fields will now appear as percentages.

Note     Use the ApplyChanges method to apply any changes made to the list.

    Sub DisplayAsPercentage()
'Displays all fields of type fpFieldNumber as
'a percentage

    Dim objApp As FrontPage.Application
    Dim objLstFlds As ListFields
    Dim strName As String
    Dim objLstFld As Object

    Set objApp = FrontPage.Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    'Cycle through lists and displays as a percentage
    For Each objLstFld In objLstFlds
        If objLstFld.Type = fpFieldNumber Then
            objLstFld.ShowAsPercentage = True
        End If
    Next objLstFld
    objApp.ActiveWeb.Lists.Item(0).ApplyChanges

End Sub