Share via


ListFieldNumber Object

SharePoint Designer Developer Reference

Contains information about how numbers are displayed in list fields.

Remarks

The ListFieldNumber object allows you to configure the way in which you view numbers in Office SharePoint Designer lists. Use ListFields(Index), where Index is the name or ordinal position of a field of type FieldTypeNumber, to return a single ListFieldNumber object.

Use the Add method to add a field of type FieldTypeNumber to the ListFields collection. The following example adds a new field named Total of type FieldTypeNumber to the ListFields collection. The subroutine displays the name of the new field and the name of the list to which it was added.

Use the ListFieldNumber object's DisplayFormat property to change the way in which the data will be displayed in the field.

Visual Basic for Applications
Sub CreateNumberField()
'Add new MultiLine Field
    Dim objApp As Application
    Dim objLstFlds As ListFields
    Dim strName As String
    Set objApp = Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    strName = "Total"
    'Add new Field of type FieldTypeNumber to list
    objLstFlds.Add Name:=strName, Description:="Numeric Total Field", _
                   Type:=FieldTypeNumber
    MsgBox "A new field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & "."
End Sub

See Also