Share via


TextRange.Length Property

Returns the length of the specified text range, in characters. Read-only.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
ReadOnly Property Length As Integer
    Get
'Usage
Dim instance As TextRange
Dim value As Integer

value = instance.Length
int Length { get; }

Property Value

Type: System.Int32
Long

Examples

This example sets the title font size to 48 points if the title of slide two contains more than five characters, or it sets the font size to 72 points if the title has five or fewer characters.

Set myDocument = ActivePresentation.Slides(2)

With myDocument.Shapes(1).TextFrame.TextRange

    If .Length > 5 Then

        .Font.Size = 48

    Else

        .Font.Size = 72

    End If

End With

See Also

Reference

TextRange Interface

TextRange Members

Microsoft.Office.Interop.PowerPoint Namespace