Length Property

Microsoft Excel Visual Basic

Show All

Length Property

       

Length property as it applies to the CalloutFormat object.

For a CalloutFormat object, when the AutoLength property of the specified callout is set to False, the Length property returns the length (in points) of the first segment of the callout line (the segment attached to the text callout box). Applies only to callouts whose lines consist of more than one segment (types msoCalloutThree and msoCalloutFour). Read-only Single.

expression.Length

expression   Required. An expression that returns one of the above objects.

 

Length property as it applies to the Phonetics object.

For a Phonetic object, the Length property returns the number of characters of phonetic text from the position you've specified with the Start property. Read-only Long.

expression.Length

expression   Required. An expression that returns one of the above objects.

 

Remarks

This property is read-only. Use the CustomLength method to set the value of this property for a CalloutFormat object.

Example

If the first line segment in the callout named "callout1" has a fixed length, this example specifies that the length of the first line segment in the callout named "callout2" on worksheet one will also be fixed at that length. For the example to work, both callouts must have multiple-segment lines.

Set myDocument = Worksheets(1)
With myDocument.Shapes
    With .Item("callout1").Callout
        If Not .AutoLength Then len1 = .Length
    End With
    If len1 Then .Item("callout2").Callout.CustomLength len1
End With

This example returns the length of the second phonetic text string in the active cell.

ActiveCell.FormulaR1C1 = "toukyoutotoukyoutotoukyoutoshibuyakushibuyakushibuyakuyoyogiyoyogiyoyogi"
ActiveCell.Phonetics.Add Start:=1, Length:=3, Text:="toukyouto toukyoutotoukyouto toukyoutotoukyoutotoukyouto"
ActiveCell.Phonetics.Add Start:=4, Length:=3, Text:="shibuyaku shibuyakushibuyaku"
MsgBox ActiveCell.Phonetics(2).Length