Office Document Imaging 2003 VBA Language Reference
Using the Microsoft Office Document Imaging 2003 Viewer Control
The Microsoft® Office Document Imaging Library 2003 (MODI) object model makes it possible to develop custom applications for managing document images (such as scanned and faxed documents) and the recognizable text that they contain. The MODI components include the MODI Viewer Control, an ActiveX® control that you can use to display MODI documents.
Important The MODI programmability features described in this document are available only in Microsoft Office Document Imaging 2003. The Microsoft Office XP version of document imaging does not include a programmable object model.
Using the MODI Viewer Control in a Development Project
To make the viewer control available in the Toolbox, select Microsoft Office Document Imaging 11.0 Type Library in the Components dialog box in your development environment. This selection also sets a reference in your project to the Microsoft Office Document Imaging 11.0 Type Library and makes the entire MODI object model available for automation. The viewer control corresponds to the MiDocView object in the MODI object model.
See Using the Microsoft Office Document Imaging 2003 Object Model for additional information.
Overview of the MODI Viewer Control
You can use the viewer control to display and scroll through MODI documents. You can manipulate the scaling of the document in the window, scroll the image programmatically, retrieve the user's selection as text or as an image, and return information about the contents of the viewer window and its coordinates.
MiDocView (viewer control) Properties, Methods, and Events
Loading a Document into the Viewer Control
You can load a document into the viewer control by using either of the following properties:
- Set the control's FileName property to the name of an existing MDI or TIF file.
- Set the control's Document property to a document that is already loaded in memory. (In this case, the Filename property remains empty.)
Working with the User's Selection
You can retrieve the user's selection in the viewer control window as text through the TextSelection property (which returns an IMiSelectableItem object) or as an image through the ImageSelection property (which returns an IMiSelectableImage object).
IMiSelectableItem (text selection) Properties, Methods, and Events
| Properties |
|
|---|
| Text | The recognized text in the selection. |
| Words | A collection of the words in the recognized text. |
| Methods |
|
|---|
| CopyToClipboard | Copies the selection as text to the clipboard. |
| GetSelectRects | Returns a collection of bounding rectangles. |
IMiSelectableImage (image selection) Properties, Methods, and Events
Limitations of the MODI Viewer Control
MODI automation provides powerful document management and optical character recognition (OCR) features; however, it does not automate the document scanning process itself or support image annotation.