我想把ppt文件对象在olecontainer中显示,怎样做?
如果这个对象是图片好像可以但是如果是文本,就无法显示,为什么?
只想用olecontainer来做,原因word,excel我是用ole来显示的。
如果这个对象是图片好像可以但是如果是文本,就无法显示,为什么?
只想用olecontainer来做,原因word,excel我是用ole来显示的。
解决方案 »
- DefaultExpression属性如何使用??
- 如何获取、设置 Word、Excel 的作者、标题、主题、备注等摘要信息?
- 在Access中更新这样子记录的语句该怎么写?
- 当一个应用程序在编译过程中或编译完后出现 Exception EAcessViolation错误时有什么方法来发现错误?
- 如何汉化devexpress cxgrid4.5中的'定制'弹出窗口中的所有内容.
- 请教一个canvas小问题
- 请教高手 透明 panel 的实现
- adoquery的state问题
- (100分)求教如何制作自动分区间的复杂分组统计报表?
- 1请问大家DELPHI和BCB与VC之类的比有什么特长之处呢?一般都用它们开发什么样的软件呢?20分要多说点吧?请不要像上回那样一句话吧?
- 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;