Share via


ListFieldCurrency Object

SharePoint Designer Developer Reference

Contains information about the field type used to view currency information within the list.

Remarks

The ListFieldCurrency object allows you to view information about different currency types within the currency field of the list. Use ListFields(Index), where Index is the name or ordinal position of a field of type FieldTypeCurrency, to return a single ListFieldCurrency object.

Use the Add method to add a field of type FieldTypeCurrency to the ListFields collection. The following example adds a new field named NewCurrencyField of type FieldTypeCurrency to the ListFields collection and changes the currency type to display Canadian dollars.

Visual Basic for Applications
Sub CreateCurrencyField()
'Add new Currency field
    Dim objApp As Application
    Dim objLstFlds As ListFields
    Dim objFldChoice As ListFieldCurrency
    Dim strName As String
    Set objApp = Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    strName = "NewCurrencyField"
    'Add new Field of type Currency field to list
    objLstFlds.Add Name:=strName, Description:="New Currency Field", _
                   Type:=FieldTypeCurrency, Required:=True
    Set objFldChoice = objLstFlds.Item("NewCurrencyField")
    'Change currency type to Canadian
    objFldChoice.Currency = CurrencyFieldCanada
    MsgBox "A new Field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & "."
End Sub

See Also