ValidateLabel Method  

Validate an object label to ensure it uses allowed characters.


object.ValidateLabel ( ObjectLabel )


A string which specifies the object label to be validated. This parameter cannot be a zero-length string.

Return Value

A value of True is returned if the object label is valid. Otherwise, a value of False is returned and the LastError property will return the specific cause of the failure.


Object labels are similar to Windows file names, except they are case-sensitive. The maximum length of a label string is 511 characters. Leading and trailing whitespace (spaces, tabs, linebreaks, etc.) are ignored in label names.

Illegal characters include ASCII and Unicode control characters 0 through 31, single quotes (39), double quotes (34), less than symbol (60), greater than symbol (62), pipe (124), asterisk (42) and question mark (63). It is not possible to embed null characters in the label name.

Label names may contain forward slash (47) characters and backslash (92) characters, however it is important to note that objects are not stored in a hierarchical structure. An application can create its own folder-like structure to the labels it creates, but this structure is not imposed or enforced by the control.

Labels can contain Unicode characters which are internally encoded as UTF-8.

See Also

ObjectLabel Property, Exists Method