Comparteix a través de


Objeto TextRange2 (Office)

Representa el marco de texto en un objeto Shape o ShapeRange.

Observaciones

Este objeto contiene el texto en el marco de texto, así como las propiedades y métodos que controlan la alineación y delimitación del marco de texto. Utilice la propiedad TextFrame2 para devolver un objeto TextFrame2 .

Ejemplo

En el ejemplo siguiente se agrega un rectángulo a myDocument, se agrega texto al rectángulo y, a continuación, se establecen los márgenes del marco de texto.

Set myDocument = Worksheets(1) 
With myDocument.Shapes.AddShape(msoShapeRectangle, _ 
 0, 0, 250, 140).TextFrame2 
 .TextRange.Text = "Here is some test text" 
 .MarginBottom = 10 
 .MarginLeft = 10 
 .MarginRight = 10 
 .MarginTop = 10 
End With 

Vea también

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.