ListFieldSingleLine Object

Microsoft FrontPage Visual Basic

ListFieldSingleLine Object

ListFieldSingleLine Web

Contains information about the single line field. The fpFieldSingleLine object is used to display 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.

This object is supported only by Web pages or sites that are based on Microsoft SharePoint Services.

Using the ListFieldSingleLine object

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

Sub CreateSingleLineField()
'Add new SingleLineField
    Dim objApp As FrontPage.Application
    Dim objLstFlds As ListFields
    Dim strName As String

    Set objApp = FrontPage.Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    strName = "Alternative Name"
    'Add new Field of type fpFieldSingleLine to list
    objLstFlds.Add Name:=strName, Description:="Numeric Total Field", _
                   Fieldtype:=fpFieldSingleLine
    MsgBox "A new field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & "."

End Sub