Share via


ListFieldSingleLine Object

SharePoint Designer Developer Reference

Contains information about the single line field.

Remarks

The ListFieldSingleLine object displays information that typically requires no more than a single line of text. For example, the Name and Title fields typically use the ListFieldSingleLine object to display information.

The following example creates a new field of type FieldTypeSingleLine named Alternative Name. The subroutine displays the name of the new field and the name of the list to which it was added.

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

See Also