NumberOfLines Property

Microsoft FrontPage Visual Basic

NumberOfLines Property

Returns or sets a Long that represents the number of lines that will appear in the field. Read/write.

expression.NumberOfLines

expression    Required. An expression that returns a ListFieldMultiLine object.

Example

The following example adds a new ListFieldMultiLine field named "Description" to the ListFields collection. The subroutine displays the name of the new field as well as the number of lines it will contain.

    Sub CreateMultiLine()
'Add new MultiLine Field
    Dim objApp As FrontPage.Application
    Dim objLstFlds As ListFields
    Dim ObjField As ListField
    Dim objLstFldMulti As ListFieldMultiLine
    Dim strName As String

    Set objApp = FrontPage.Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    strName = "Description"
    'Add new Field of type fpFieldMultiLine to list
    objLstFlds.Add Name:=strName, Description:="Description Field", _
                   Fieldtype:=fpFieldMultiLine
    Set objLstFldMulti = objLstFlds.Item(strName)
    objLstFldMulti.NumberOfLines = 5
    MsgBox "A new field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & ". It contains " & _
           objLstFldMulti.NumberOfLines & " lines."

End Sub