Top Property
Returns the distance in pixels of the top edge of the specified rectangle from the top edge of the containing image. Read-only Long.
expression.Top
*expression * Required. An expression that returns an MiRect or an MiSelectRect object.
Example
The following example performs optical character recognition (OCR) on the first image in a document, and then reports the coordinates of the bounding rectangle surrounding the third word in the recognized text.
Sub TestRectangleProperties()
Dim miDoc As MODI.Document
Dim miWord As MODI.Word
Dim miRects As MODI.miRects
Dim miRect As MODI.miRect
Dim strRectInfo As String
Set miDoc = New MODI.Document
miDoc.Create "C:\document1.tif"
miDoc.Images(0).OCR
Set miRects = miDoc.Images(0).Layout.Words(2).Rects
strRectInfo = "Word falls within " & miRects.Count & _
" bounding rectangle(s)." & vbCrLf
For Each miRect In miRects
strRectInfo = strRectInfo & _
" Rectangle coordinates: " & vbCrLf & _
" - Left: " & miRect.Left & vbCrLf & _
" - Right: " & miRect.Right & vbCrLf & _
" - Top: " & miRect.Top & vbCrLf & _
" - Bottom: " & miRect.Bottom
Next
MsgBox strRectInfo, vbInformation + vbOKOnly, _
"Rectangle Information"
Set miRect = Nothing
Set miRects = Nothing
Set miWord = Nothing
Set miDoc = Nothing
End Sub
Applies to | MiRect Object | MiSelectRect Object