使用了如下方法,但不行:--加载
OleContainer1.DestroyObject;
OleContainer1.CreateObjectFromFile(‘D:\A.doc’, False);--打印预览
OleContainer1.OleObject.Application.ActiveDocument.PrintPreview;--报错:
Project Project1.exe raised exception class EIntfCastError with message 'Interface not supported'. Process stopped. Use Step or Run to continue.--调试时查看OleObject,没有值,直接异常了
OleContainer1.DestroyObject;
OleContainer1.CreateObjectFromFile(‘D:\A.doc’, False);--打印预览
OleContainer1.OleObject.Application.ActiveDocument.PrintPreview;--报错:
Project Project1.exe raised exception class EIntfCastError with message 'Interface not supported'. Process stopped. Use Step or Run to continue.--调试时查看OleObject,没有值,直接异常了
解决方案 »
- VCLSKIN是不是不支持框?我试用后,mdiChild类型的窗口没有完全被美化
- Delphi调用C++动态库问题,虽然老话重谈,但是我参考以前的贴子,没有找到解决办法!急!!!
- 如何有效的防止修改MAC地址?
- 初学者问--打开一个文件,然后要把这个文件名显示在主窗体上,应该怎么做?还有一些相关的问题--请入……
- 用delphi怎麼能夠取得網葉上的cookie和session的直?
- 崔永元:实话实说 - 拉登篇
- 怎样判定11个TCheckBox组件中,哪个是最后选中的?
- Delphi6.0中怎样使用OpenDialog?(一定给分)
- 征求解决方案!
- 一个关于TWebBrowser的问题
- delphi如何实现main.exe监控sub.exe?
- 关于TWebbrowser或CEF3控件打不开网页的问题
procedure TForm1.Button1Click(Sender: TObject);
begin
OleContainer1.DestroyObject;
OleContainer1.CreateObjectFromFile('D:\A.doc', false);
OleContainer1.DoVerb(ovShow);
OleContainer1.Run;
OleContainer1.OleObject.Application.ActiveDocument.PrintOut;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
OleContainer1.DestroyObject;
OleContainer1.CreateObjectFromFile('D:\A.doc', false);
OleContainer1.DoVerb(ovShow);
OleContainer1.Run;
OleContainer1.OleObject.Application.ActiveDocument.Protect(2);
OleContainer1.OleObject.application.CommandBars['Standard'].Visible:=false;
OleContainer1.OleObject.application.CommandBars['Formatting'].Visible:=false;
OleContainer1.OleObject.application.CommandBars['Reviewing'].Visible:=false;
OleContainer1.OleObject.Application.ActiveDocument.PrintOut;
end;