Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

Len Function

Returns the number of characters in a string, or the number of bytes that are required to store a variable.

Syntax:


Len (Text As String)

Return value:

Long

Parameters:

Text: Any string expression or a variable of another type.

Error codes:

5 Invalid procedure call

Example:


Sub ExampleLen
Dim sText as String
    sText = "Las Vegas"
    MsgBox Len(sText) ' 9
End Sub