TextRange.RotatedBounds Method
Returns the coordinates of the vertices of the text bounding box for the specified text range.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Sub RotatedBounds ( _
<OutAttribute> ByRef X1 As Single, _
<OutAttribute> ByRef Y1 As Single, _
<OutAttribute> ByRef X2 As Single, _
<OutAttribute> ByRef Y2 As Single, _
<OutAttribute> ByRef X3 As Single, _
<OutAttribute> ByRef Y3 As Single, _
<OutAttribute> ByRef x4 As Single, _
<OutAttribute> ByRef y4 As Single _
)
'Usage
Dim instance As TextRange
Dim X1 As Single
Dim Y1 As Single
Dim X2 As Single
Dim Y2 As Single
Dim X3 As Single
Dim Y3 As Single
Dim x4 As Single
Dim y4 As Single
instance.RotatedBounds(X1, Y1, X2, Y2, X3, _
Y3, x4, y4)
void RotatedBounds(
out float X1,
out float Y1,
out float X2,
out float Y2,
out float X3,
out float Y3,
out float x4,
out float y4
)
Parameters
- X1
Type: System.Single
- Y1
Type: System.Single
- X2
Type: System.Single
- Y2
Type: System.Single
- X3
Type: System.Single
- Y3
Type: System.Single
- x4
Type: System.Single
- y4
Type: System.Single
Examples
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).TextFrame.TextRange.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