Text property (Shape object)

Microsoft Visio Developer Reference

Text property (Shape object)

   Example   

Returns all of the shape's text.

Version added

2.0

Syntax

strRet = object.Text
object.Text = stringExpression

strRet

String. The text of the Shape object returned as a string.

object

Required. An expression that returns a Shape object.

stringExpression

Required String. New text for the Shape object.

Remarks

In the text returned by the Text property of a Shape object, fields are represented by an escape character (30 (&H1E)) For example, if a Shape object's text contains a field that displays the file name of a drawing, the Shape object's Text property returns an escape character where that field is inserted into the text. If you want the text to contain the expanded field, get the shape's Characters property, then get the Text property of the resulting Characters object.

If the shape is a group, the text returned is dependent on the value of the IsTextEditTarget cell.

  • If IsTextEditTarget is TRUE, then the Text property of the Shape object returns the text of the group.
  • If IsTextEditTarget is FALSE, then the Text property of the Shape object returns the text of the shape in the group at the top of the stacking order.

Objects from other applications and guides don't have a Text property.