Office) (TextRange2.RotatedBounds 方法

會取得指定文字範圍的文字邊界頂點座標。 唯讀。

語法

運算式。RotatedBounds (X1, Y1, X2, Y2, X3, Y3, x4, Y4)

運算式 傳回 TextRange2 物件的運算式。

參數

名稱 必要/選用 資料類型 描述
X1 必要 Single 傳回指定文字範圍內文字的邊界方塊第一個頂點的 X 座標) 位置 (。
Y1 必要 Single 傳回指定文字範圍內文字之邊界方塊第一個頂點的 Y 座標) 位置 (。
X2 必要 Single 傳回指定文字範圍內文字之邊界方塊第二個頂點的 X 座標) 位置 (。
Y2 必要 Single 傳回指定文字範圍內文字之週框方塊第二個頂點的 Y 座標) 點的位置 (。
X3 必要 Single 傳回指定文字範圍內文字的邊界方塊第三個頂點的 X 座標) 位置 (。
Y3 必要 Single 傳回指定文字範圍內文字之邊界方塊第三個頂點的 Y 座標) 點的位置 (。
x4 必要 Single 傳回指定文字範圍內文字的邊界方塊第四個頂點的 X 座標) 位置 (。
Y4 必要 Single 傳回指定文字範圍內文字之邊界方塊第四個頂點的 Y 座標) 點的位置 (。

註解

文字週框方塊不 TextFrame2 物件相同。 TextFrame2 物件代表文字可以都位於的容器。 文字週框方塊代表周邊立即周圍的文字。

範例

此範例會使用已在使用中簡報的投影片上第一個圖案中文字範圍內文字邊界的第三個字的尺寸繪製的手繪多邊形 RotatedBounds 方法的引數所傳回的值。

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 

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。