BoundTop 属性 (Publisher)TextRange.BoundTop property (Publisher)

返回一个**** 指示的距离, 以为单位, 从最上端页面的上边缘到指定文字范围的边界框的上边缘。Returns a Single indicating the distance, in points, from the top edge of the topmost page to the top edge of the bounding box for the specified text range. 此为只读属性。Read-only.

语法Syntax

表达式BoundTopexpression.BoundTop

_表达式_一个代表**TextRange** 对象的变量。expression A variable that represents a TextRange object.

返回值Return value

单精度Single

示例Example

以下示例显示当前出版物中,环绕第一页上第一个形状中的文字的边界框的位置、宽度和高度。The following example displays the position, width, and height of the bounding box surrounding the text in the first shape on page one of the active publication.

Dim rngText As TextRange 
Dim strMessage As String 
 
Set rngText = ActiveDocument.Pages(1) _ 
 .Shapes(1).TextFrame.TextRange 
 
With rngText 
 strMessage = "Text frame information" & vbCrLf _ 
 & " Distance from left edge of page: " _ 
 & .BoundLeft & " points" & vbCrLf _ 
 & " Distance from top edge of page: " _ 
 & .BoundTop & " points" & vbCrLf _ 
 & " Width: " & .BoundWidth & " points" & vbCrLf _ 
 & " Height: " & .BoundHeight & " points" 
End With 
 
MsgBox strMessage

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.