RotatedBounds Method 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).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