添加一个System面板上的OLEContainer控件,一个openDialog控件,一个Button
在Button的 click事件中加入代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
if opendialog1.Execute then
begin
olecontainer1.CreateObjectfromfile(opendialog1.FileName,false );
olecontainer1.run;
end;
end;
运行时点button,选择一个word文档,然后双击OLEContainer就可以了
在Button的 click事件中加入代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
if opendialog1.Execute then
begin
olecontainer1.CreateObjectfromfile(opendialog1.FileName,false );
olecontainer1.run;
end;
end;
运行时点button,选择一个word文档,然后双击OLEContainer就可以了
解决方案 »
- delphi如何访问webbrowser网页中的多维数组
- TStrings无法编辑,有谁碰到过这种问题?
- 动态创建的控件怎么去触发他的事件?
- 碰到一个和大富翁上同样的问题,求救
- 有关Delphi中消息处理
- 请问如何将MDIchild窗体居中?在线等…
- 关于TTreeView和节点动作的问题?
- 各位大侠,请问哪有DELPHI4的安装程序?深圳有DELPHI4的请留下你的EMAIL,TKS
- 大虾们!帮忙呀?谁能给我详细介绍一下delphi ado 的 ERROR集的用法-----急用呀。。。。。。。。。。。。。。。。。。
- 请各位帮着看看?编程过程中遇到难题了。
- 对两个数据库的表字段查询
- 如何制作像google的引擎!
var
wordApp: Variant;
begin
if FileExists('e:\delphi\word\wang1.doc') then
begin
wordApp:=CreateOleObject('word.Application');
wordApp.Documents.Open('e:\delphi\word\wang1.doc');
wordApp.Visible :=True;
end
else
begin
Application.Messagebox('对不起,没有相应的文件!','提示',MB_OK+MB_ICONQUESTION);
end;end;
即在uses声明中加入comobj