使用ComObj的方式产生的Word能够像MDI的子窗体一样显示么〉? 偶现在使用ComObj的方式调用Word,已经能够正常的调出Word程序了,但这个Word是单独的,想要实现MDI的那样的方式,将调出的Word窗口作为MDI的子窗体不晓得是否可以,请大家帮忙。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该oleContainer控件可以实现! unit Main;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtnrs, ExtCtrls, OleCtrls, SHDocVw;type TForm1 = class(TForm) OleContainer1: TOleContainer; Panel1: TPanel; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin OleContainer1.CreateLinkToFile(ExtractFilePath(Application.ExeName) + 'default.ppt',False); //OleContainer1.DoVerb(0); //直接F5了 //OleContainer1.OleObject.Preview;end;procedure TForm1.Button2Click(Sender: TObject);var V:Variant;begin oleContainer1.CreateObject('Excel.Sheet.8',false); oleContainer1.DoVerb(ovshow); V:=OleContainer1.OleObject; V.Application.CommandBars['Standard'].Visible := True; V.Application.CommandBars['Formatting'].Visible := True; //不显示菜单及工具栏end;end. 多些楼上的指点,不过使用这种方式的话,那么VBA的命令是否可用呢? 用Delphi编写一个简单的文本编辑器,怎样实现关键字高亮显示? delphi 與 foxpro 的日期轉換 新点子:如何开发代理服务器,有兴趣的进来看看,欢迎高手进来指点指点! 如何判断Image控件已赋图片? 如何做登陆程序? 如何调整的QRDBText字间距?大虾求命! 哪有中文的HELP文件? 这条语句错在那了? 哪位高手能将我的VB代码转换为Delphi? 多谢谢 有什么方法可以取得当前操作系统的临时文件夹的路径? 用C写的DLL,用DELPHI怎样调用 关于StringGrid的使用
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtnrs, ExtCtrls, OleCtrls, SHDocVw;type
TForm1 = class(TForm)
OleContainer1: TOleContainer;
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
OleContainer1.CreateLinkToFile(ExtractFilePath(Application.ExeName) + 'default.ppt',False);
//OleContainer1.DoVerb(0); //直接F5了
//OleContainer1.OleObject.Preview;
end;procedure TForm1.Button2Click(Sender: TObject);
var
V:Variant;
begin
oleContainer1.CreateObject('Excel.Sheet.8',false);
oleContainer1.DoVerb(ovshow);
V:=OleContainer1.OleObject;
V.Application.CommandBars['Standard'].Visible := True;
V.Application.CommandBars['Formatting'].Visible := True; //不显示菜单及工具栏
end;
end.