delphi 调用modi的问题
取昵称麻烦 2010-08-02 03:02:15 我在网络上搜索到delphi调用modi的方法以及语句如下:
Try to use the Active X given with Microsoft Office named Microsoft Office Document Imaging.
1) Click menu "Component" > "Import ActiveX control".
2) Select the "Microsoft Office Document Imaging 11.0 Type Library"
3) Click "Create unit".
After doing so, the component will be in the ActiveX component page.
Add "ComObj, MODI_TLB" to the uses clause.
Drop "MiDocView" to the form.
procedure TForm.Button1Click(Sender: TObject);
Var
Img :IImage;
Layout :ILayout;
begin
doc := IDispatch(CreateOleObject('MODI.Document')) as IDocument;
doc.create('c:\test.bmp');
doc.ocr(miLANG_ENGLISH,true,true);
Img := IDispatch(doc.Images[0]) as IImage;
Layout := IDispatch(Img.Layout) as ILayout;
Memo1.Lines.Add(Layout.Text);
MiDocView1.Document := doc;
doc.Close(false);
Img := nil;
Layout := nil;
end;
问题是运行到doc.create('c:\test.bmp')的时候就提示“未注册类别”。
请教怎么解决?