Table of contents
TOC
Collapse the table of content
Expand the table of content

TextRange2.RotatedBounds Method (Office)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Gets the coordinates of the vertices of the text bounding box for the specified text range. Read-only.

Syntax

expression. RotatedBounds( X1, Y1, X2, Y2, X3, Y3, x4, y4 )

expression An expression that returns a TextRange2 object.

Parameters

NameRequired/OptionalData TypeDescription
X1RequiredSingleReturns the position (in points) of the X coordinate of the first vertex of the bounding box for the text within the specified text range.
Y1RequiredSingleReturns the position (in points) of the Y coordinate of the first vertex of the bounding box for the text within the specified text range.
X2RequiredSingleReturns the position (in points) of the X coordinate of the second vertex of the bounding box for the text within the specified text range.
Y2RequiredSingleReturns the position (in points) of the Y coordinate of the second vertex of the bounding box for the text within the specified text range.
X3RequiredSingleReturns the position (in points) of the X coordinate of the third vertex of the bounding box for the text within the specified text range.
Y3RequiredSingleReturns the position (in points) of the Y coordinate of the third vertex of the bounding box for the text within the specified text range.
x4RequiredSingleReturns the position (in points) of the X coordinate of the fourth vertex of the bounding box for the text within the specified text range.
y4RequiredSingleReturns the position (in points) of the Y coordinate of the fourth vertex of the bounding box for the text within the specified text range.

Remarks

The text bounding box is not the same as the TextFrame2 object. The TextFrame2 object represents the container in which the text can reside. The text bounding box represents the perimeter immediately surrounding the text.

Example

This example uses the values returned by the arguments of the RotatedBounds method to draw a freeform that has the dimensions of the text bounding box for the third word in the text range in shape one on slide one in the active presentation.

Dim x1 As Single, y1 As Single 
Dim x2 As Single, y2 As Single 
Dim x3 As Single, y3 As Single 
Dim x4 As Single, y4 As Single 
Dim myDocument As Slide 

Set myDocument = ActivePresentation.Slides(1) 
myDocument.Shapes(1).TextFrame2.TextRange2.Words(3).RotatedBounds _ 
 x1, y1, x2, y2, x3, y3, x4, y4 
With myDocument.Shapes.BuildFreeform(msoEditingCorner, x1, y1) 
 .AddNodes msoSegmentLine, msoEditingAuto, x2, y2 
 .AddNodes msoSegmentLine, msoEditingAuto, x3, y3 
 .AddNodes msoSegmentLine, msoEditingAuto, x4, y4 
 .AddNodes msoSegmentLine, msoEditingAuto, x1, y1 
 .ConvertToShape.ZOrder msoSendToBack 
End With 

See also

Concepts

TextRange2 Object

Other resources

TextRange2 Object Members

© 2018 Microsoft