Share via


ListFieldURL Object

SharePoint Designer Developer Reference

Contains information about the field that displays URLs.

Remarks

The ListFieldURL object allows you to customize the way URLs appear in list fields. The URL can be displayed as an image or as a link. Use the DisplayFormat property to change the view settings.

Use ListFields(Index), where Index is the name or ordinal position of a field of type FieldTypeURL, to return a single ListFieldURL object.

The following example creates a new field of type FieldTypeURL and displays the name of the new field and the name of the list into which it was inserted.

Visual Basic for Applications
Sub CreateURLField()
'Add new URL 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 = "Location"
    'Add new Field of type FieldTypeURL to list
    objLstFlds.Add Name:=strName, Description:="Displays file locations", _
                   Type:=FieldTypeURL
    MsgBox "A new field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & "."
End Sub

See Also