Word Object

Multiple objects

Represents a word recognized in the text during an optical character recognition (OCR) operation.

Using the Word Object

Use the Words accessor property of the Layout or IMiSelectableItem object to return a Words collection. Use the Item property of the Words collection to return a Word object and gain access to the properties that describe its text (Text), font (Font), location (Id, LineId, and RegionId), and recognition confidence factor (RecognitionConfidence).

In East Asian languages, each character is also treated as a word.


The following example performs OCR on the first page of a document, and then reports the properties of the third recognized word.

Sub TestWords()
  Dim miDoc As MODI.Document
  Dim miWord As MODI.Word
  Dim strWordInfo As String
  ' Load an existing TIFF file.
  Set miDoc = New MODI.Document
  miDoc.Create "C:\document1.tif"
  ' Perform OCR.
  ' Retrieve and display word information.
  Set miWord = miDoc.Images(0).Layout.Words(2)
  strWordInfo = _
    "Id: " & miWord.Id & vbCrLf & _
    "Line Id: " & miWord.LineId & vbCrLf & _
    "Region Id: " & miWord.RegionId & vbCrLf & _
    "Font Id: " & miWord.FontId & vbCrLf & _
    "Recognition confidence: " & _
    miWord.RecognitionConfidence & vbCrLf & _
    "Text: " & miWord.Text
  MsgBox strWordInfo, vbInformation + vbOKOnly, _
    "Word Information"
  Set miWord = Nothing
  Set miDoc = Nothing

End Sub

Properties | Font Property | FontId Property | Id Property | LineId Property | RecognitionConfidence Property | Rects Property | RegionId Property | Text Property

Parent Objects

Child Objects | MiFont Object | MiRects Object