怎样直接调用并全屏显示已经做好的幻灯片(ppt)(100分)

  • 主题发起人 主题发起人 lengpeng
  • 开始时间 开始时间
L

lengpeng

Unregistered / Unconfirmed
GUEST, unregistred user!
我想做一个程序调用已经做好的幻灯片(ppt格式),全屏显示它,用按钮控制它的显示,怎么做请各位帮忙!
 
可以到微软的网站下 ppviewer.exe
 
将.ppt 改成 .pps 就可以直接播放
 
我说的是在程序中调用,调用幻灯片只是是我程序的一部分,请大家帮帮忙!
 
control Powerpoint with OLE-Automation?

uses
comobj;


procedure TForm1.Button2Click(Sender: TObject);

var
PowerPointApp: OLEVariant;

begin

try
PowerPointApp := CreateOleObject('PowerPoint.Application');

except
ShowMessage('Error...');

Exit;

end;


// Make Powerpoint visible
PowerPointApp.Visible := True;


// Show powerpoint version
ShowMessage(Format('Powerpoint version: %s',[PowerPointApp.Version]));


// Open a presentation
PowerPointApp.Presentations.Open('c:/MyPresentation.ppt', False, False, True);


// Show number of slides
ShowMessage(Format('%s slides.',[PowerPointApp.ActivePresentation.Slides.Count]));


// Run the presentation
PowerPointApp.ActivePresentation.SlideShowSettings.Run;


// Go to next slide
PowerPointApp.ActivePresentation.SlideShowWindow.View.Next;


// Go to slide 2
PowerPointApp.ActivePresentation.SlideShowWindow.View.GoToSlide(2);


// Go to previous slide
PowerPointApp.ActivePresentation.SlideShowWindow.View.Previous;


// Go to last slide
PowerPointApp.ActivePresentation.SlideShowWindow.View.Last;


// Show current slide name
ShowMessage(Format('Current slidename: %s',[PowerPointApp.ActivePresentation.SlideShowWindow.View.Slide.Name]));


// Close Powerpoint
PowerPointApp.Quit;

PowerPointApp := UnAssigned;

end;
 
答得如此之全面,我看就不用再说什么了
 
Aiirii,真是厉害,问题基本解决了,但能不能不出现编辑页面直接播放呀,我试过改成.pps格式了,可还是有一个调用过程,帮帮忙!
 
小弟还有一个问题
// Open a presentation
PowerPointApp.Presentations.Open('c:/MyPresentation.ppt', False, False, True);


怎样使它在相对路径下打开呀!
 
后退
顶部