locked
vb6 MODI select rectangle to OCR by code not by user select RRS feed

  • Question

  •  

    i am using a MODI in vb6

    i am scaning a big number of tif files

    then i want to select an rectangle by code (NOT BY USER SELECTION) in every tif

    and recognize this rectangle selection by ocr and give a name to every tif from recognized text.

     

    i found that there is two properties

    TextSelection and ImageSelection but i cant give the BoundingRect by code.

     

    are its possible to select rectangle a nd OCR it without user selection

     

    Please this is urgent

     

    halsoft

     

    Saturday, November 24, 2007 7:35 PM

All replies

  • Hi,

    If I understood your request then the following code is from MSDN link.

    I hope it helps

     

    http://msdn2.microsoft.com/en-us/library/aa203300(office.11).aspx

    Sub TestRects()
     
      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

    Good luck.

    Pinokio

    Friday, April 11, 2008 2:28 PM
  • Hi everyone

     

    Me to suffer in this same problem can anyone help me this case

     

    Advance thanks

    Tuesday, August 31, 2010 8:59 AM