Platform SDK: CDO 1.2.1 |
The Name property returns the name of the field as a string. Read-only.
objField.Name
objField.Name(PropsetID)
String
The Name property is read-only. You set the name of the Field object at the time you create it, when you call the Fields collection's Add method.
The length of the name of a custom property is limited to 120 characters. An attempt to exceed this limit returns an error. Note that this limitation does not apply to the value of the property.
Field objects used to access predefined MAPI properties do not have names. Names appear only on the custom properties that you create. For more information, see the Item property documentation for the Fields collection.
' fragment from Fields_Add Dim objNewField As Object ' new Field object Set objNewField = objFieldsColl.Add( _ Name:="Keyword", _ Class:=vbString, _ Value:="Peru") If objNewField Is Nothing Then MsgBox "could not create new Field object" Exit Function End If cFields = objFieldsColl.Count MsgBox "new Fields collection count = " & cFields ' later: fragment from Field_Name; modified to use objNewField If "" = objNewField.Name Then MsgBox "Field has no name; ID = " & objNewField.ID Else MsgBox "Field name = " & objNewField.Name End If