ListFieldSingleLine |
包含关于单行域的信息。fpFieldSingleLine 对象用来显示通常不超过一行文本的信息。例如,Name 和 Title 域通常使用 ListFieldSingleLine 对象来显示信息。
下列示例创建名为 Alternative Name 的 ListFieldSingleLine 类型的新域。该子例程显示了新域的名称以及将此域添加到的列表的名称。
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