如何在Delphi编写的程序里,播放PowerPoint?我在sustem里找到一个Olecontainer,可以引入一个PowerPoint文件,但是不播放,不知这么做是不是不行?谢谢!

解决方案 »

  1.   

    Vcl的Servers标签里有PP的组件。
      

  2.   

    同意楼上的说法
    delphi里自己带了的
    楼主你自己找找看
      

  3.   

    如果用的是Delphi 7.0以上的版本带有PP的组件
      

  4.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, PowerPointXP, OleServer, office2000;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        Button3: TButton;
        Button4: TButton;
        pptA: TPowerPointApplication;
        pptP: TPowerPointPresentation;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);
        procedure Button4Click(Sender: TObject);
      private
         ssWin: SlideShowWindow;
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      pptA.Visible := msoTrue;
      pptA.Presentations.Open('left-right.ppt', msoFalse, msoFalse, msoTrue);
      PPtP.ConnectTo(pptA.ActivePresentation);
      PPtP.SlideShowSettings.LoopUntilStopped:=msoFalse;
      PPtP.SlideShowSettings.ShowType := ppShowTypeSpeaker;
      PPtP.SlideShowSettings.Run;
      ssWin := PPtP.SlideShowWindow;
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
      ssWin.View.Next;
    end;procedure TForm1.Button3Click(Sender: TObject);
    begin
      ssWin.View.Previous;
    end;procedure TForm1.Button4Click(Sender: TObject);
    begin
      try
        pptA.Disconnect;
        pptA.Quit;
        if assigned(pptA) then pptA.Free;
      except
        showmessage('PowerPoint has already closed!');
      end;
    end;end.
      

  5.   

    这个是创建一个单独的powerpoint,能不能在程序窗口中打开一个powerpoint呢?olecontainer。
      

  6.   

    PowerPoint可以保存为可执行文件啊,然后有个什么ShellAPI函数可以(不好意思,一段时间没用,忘记,可以查帮助的)执行外部文件的