One, according to a post on the BBS I installed the Microsoft Modi Ocr:
1. Install the Office 2007 (using custom installation, choose Microsoft Office Document Imaging related project)
2. Installing Office 2007 SP2 (can't install SP2 please install a Windows Installer 4.5)
3. Install Microsoft MODI identify component installation package
Two, add a form in Delphi, and cited in the USES Comobj,
Three, in the form to add a memo and a button, the button code:
Var
Doc, layout: the Variant;
I: integer;
STR: string;
The begin
Doc:=CreateOleObject (' MODI. Document);
If OpenDialog1. Execute then
Try
Doc. Create (OpenDialog1. FileName);
Screen. The Cursor:=crHourGlass;
Doc. OCR (1028);
Screen. The Cursor:=crDefault;
For I:=0 to doc. Images. Do the Count - 1
The begin
STR:=STR + doc. Images. Item [I] Layout. The Text;
end;
Memo1. Lines. Text:=STR;
ShowMessage (' Finished! ');
Doc. Close;
Doc:=the UnAssigned;
Except on E: the Exception do
ShowMessage (e. oString);
end;
Four, compiler, click on the button has been submitted to the "not registered", ie, it has a problem: doc. Create (OpenDialog1. FileName);
Do successful friends advice me, this thing bothering me for a long time, thank you
CodePudding user response:
Does anyone know? Please check it, thank you!CodePudding user response:
Management tools - & gt; Component services - & gt; DCOM configuration, see the Microsoft Office Document Imaging is there,CodePudding user response: