我想把ppt文件对象在olecontainer中显示,怎样做?
如果这个对象是图片好像可以但是如果是文本,就无法显示,为什么?
只想用olecontainer来做,原因word,excel我是用ole来显示的。
如果这个对象是图片好像可以但是如果是文本,就无法显示,为什么?
只想用olecontainer来做,原因word,excel我是用ole来显示的。
解决方案 »
- 如何用mciSendString API加背景音乐
- 各位高手,如何实现在fastreport中的richtext object的自动分页?在线等!!!!!
- [在线等] 急:如何把DBGRID里的数据存入另外一个表?
- TMediaPlayer为什么不能播放MP3??????
- gardenyang :给分贴2
- 关于ListView的问题,还望大家多多指教!
- 请问DELPHI中的问题
- 如何实现gif动画的旋转
- 用access 数据库 短日期 类型的查询无结果
- 为什么装过东方影都后mediaplayer控件老是出错(东方影都真是垃圾一堆)?
- delphi读内存的问题 返回值总是0
- 我现在遇到的问题是,一个窗体中需要显示的东东太多,请问各位怎样给窗体加上滚动条?
//--新建ppt空白文档--//不能显示出来不知道为什么?
procedure TFrm_Main.PPT1Click(Sender: TObject);
begin
Form1:=TForm1.Create(application);
Form1.Caption:='新建文档'+Inttostr(Frm_Main.MDIChildCount-1);
MDITab1.AddTab(Form1,3);
with Form1 do
begin
oleContainer1.CreateObject('PowerPoint.Slide',true);
oleContainer1.DoVerb(0);
end;
end;//--打开表中的文件或文件夹--//打开时也不能显示ppt文件
procedure TFrm_Guide.FileOpen_ActionExecute(Sender: TObject);
var
filename,extname,path,TempPath:string;
temp:TAdoquery;
tempitem:TListItem;
i:integer;
begin
if (ListView.Items.Count>0) and (ListView.Selected<>nil) and (ListView.Items[ListView.ItemIndex].SubItems.Count>0) then //--如果选择了文件--//
begin
Form1:=Tform1.Create(application);
tempitem:=ListView.Items[ListView.ItemIndex];
path:= tempitem.SubItems[0];
filename:= tempitem.Caption;
extname:= tempitem.SubItems[1];
Form1.Caption:=filename;
TempPath:=CreateTempFile(PList(tempitem.Data)^.ID,Extname);//生成临时文件路径
Frm_Main.MDITab1.AddTab(Form1,tempitem.ImageIndex);
Try
temp:=TAdoQuery.Create(self);
temp.Connection:=Frm_Main.ADOConn;
With Temp do
begin
close;
sql.Clear;
sql.Add('select * from TB_File where ID= :ID');
Parameters[0].Value:=PList(tempitem.Data)^.ID;
open;
if not temp.Eof then
begin
TBlobField(FieldByName('FileContent')).SaveToFile(TempPath);
Form1.CreateFromFile(TempPath,PList(tempitem.Data)^.ID);
end;
end;
Finally
temp.free;
end;
end
else //如果选择了目录 ,则显示其下的所有文件和目录在listview中,同时至tree相应的目录节点为选中状态
begin
if ListView.Selected<>nil then //--选择不为空时--//
for i:=1 to Tree.Items.Count-1 do
if PMyNode(Tree.Items.Item[i].Data)^.ID=PList(ListView.Items[ListView.ItemIndex].Data)^.ID then
begin
ListView.Clear;
Tree.Items.Item[i].Selected:=true;
Tree.SetFocus;
DisplayDir(Tree.Items.Item[i]);
break;
end;
end;
end;小弟开发一个文档管理系统时遇到左难题
问题就是无法显示ppt,无论是空白,还是有文件...
各位高手快帮助呀
用代码控制也行.
var
pptA: TPowerPointApplication;
pptP: TPowerPointPresentation;
ssSet: SlideShowSettings;
ssWin: SlideShowWindow;
procedure TForm1.FormCreate(Sender: TObject);
begin
pptA := TPowerPointApplication.Create(self);
pptA.Visible := msoTrue;
PPtP.ConnectTo(pptA.Presentations.Open(’h:\php.pps’, msoFalse, msoFalse, msoTrue));
ssSet := PPtP.SlideShowSettings;
ssSet.LoopUntilStopped := msoFalse;
ssSet.ShowType := ppShowTypeSpeaker;
ssSet.Run;
ssWin := PPtP.SlideShowWindow;
end; procedure TForm1.Button2Click(Sender: TObject);
begin
sswin.View.next;//下一页
end; procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
try
pptA.Disconnect;
pptA.Quit;
if assigned(pptA) then pptA.Free;
except
showmessage(’PowerPoint has already closed!’);
end;
end;