Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activate MODI from Excel VBA sub

Status
Not open for further replies.

bpeirson

Technical User
Sep 28, 2005
85
CA
I am trying to activate the Microsoft Office Document Imaging (MODI) application from an Excel VBA sub. I have found help files for activating Word and paint but the details I need to activate MODI seem to be missing from the library.

My goal is to be able to scan and save a document with the name being supplied by Excel. Later I would like to be able to print or fax the same document in a similar fashion.

Any help is appreciated.

 
Thanks for the help files but specific VBA programming is still not available for MODI.

For example, this is a line from my VBA Sub.

Code:
    Dim PICT As MODI.Document

When I press F1 with the cursor on MODI I get a keyword not found message. When I use the help from the MODI program there are no chapters for VBA. When I lookup MODI in the object browser I can find all the objects and methods but I do not have enough skill or training to apply them without more guidance.

I have the ability to use Excel to print documents after inserting them into a page but this will create excess formatting requirments and use excessive amounts of system resources. On a small scale this is unimportant but with time the demands of this little program may require streamlined code.
Most of the code I use is based on modifying the macros recorded in Excel (heavily modified). MODI does not support a MACRO recorder so I am at a loss as to how to put all the objects and methods together for MODI.
 
hi all i am trying OCR documents using the code (lifted from msdn)

is there a way of modifying the code below , to ocr the tifs and then save them.

Please can anyone help point me in the direction of a function or website.

thanks
Chris


Code:
 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 frmupload.txtDirectory + fil 'directory
  
  miDoc.Images(0).OCR
  miDoc.OCR miLANG_ENGLISH, True, True
  
  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
 
Also is there anyway to find out if a tif has been OCRed already to not chug computer time.

Many thanks in advance

Chris
 
This was my resolution just for the record
Code:
        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 frmupload.txtDirectory + fil
          
          miDoc.Images(0).OCR
          miDoc.OCR miLANG_ENGLISH, True, True
          miDoc.Save
          'added the OCR on the end of the file name
          
    
          Set miRect = Nothing
          Set miRects = Nothing
          Set miWord = Nothing
          Set miDoc = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top