unit MainUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, ExtCtrls, PowerPointXP, OleServer;
type
TForm1 = class(TForm)
Button1: TButton;
OpenDialog1: TOpenDialog;
Button2: TButton;
Button3: TButton;
LinkButton: TButton;
ExitButton: TButton;
Edit1: TEdit;
Panel1: TPanel;
WebBrowser1: TWebBrowser;
Memo1: TMemo;
ppta: TPowerPointApplication;
pptp: TPowerPointPresentation;
procedure WebBrowser1BeforeNavigate2(Sender: TObject;
const pDisp: IDispatch;
var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant;
var Cancel: WordBool);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
HistoryList: TStringList;
HistoryIndex: Integer;
UpdateCombo: Boolean;
procedure FindAddress;
end;
var
Form1: TForm1;
global_url:string;
ghh: integer = 0;
implementation
{$R *.dfm}
procedure TForm1.WebBrowser1BeforeNavigate2(Sender: TObject;
const pDisp: IDispatch;
var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant;
var Cancel: WordBool);
begin
global_url := URL;
memo1.Lines.Add(global_url);
end;
//open file
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
global_url := OpenDialog1.filename;
Form1.FindAddress;
pptA.Visible := 1;
PPtP.ConnectTo(pptA.Presentations.Open(opendialog1.FileName, 0, 0, 1));
end;
end;
//link to webbrowser
procedure TForm1.FindAddress;
var
Flags: OLEVariant;
begin
Flags := 0;
UpdateCombo := True;
WebBrowser1.Navigate(WideString(global_url), Flags, Flags, Flags, Flags);
end;
//preview
procedure TForm1.Button3Click(Sender: TObject);
var
MySlideShowWindow: SlideShowWindow;
MyView:SlideShowview;
begin
MySlideShowWindow:= ppta.Presentations.Item(1).SlideShowSettings.Run;
MySlideShowWindow._AddRef;
MyView := MySlideShowWindow.View;
MyView._AddRef;
MyView.Previous;
MySlideShowWindow._Release;
MyView._Release;
end;
//next
procedure TForm1.Button2Click(Sender: TObject);
var
MySlideShowWindow: SlideShowWindow;
MyView:SlideShowview;
begin
MySlideShowWindow:= ppta.Presentations.Item(1).SlideShowSettings.Run;
MySlideShowWindow._AddRef;
MyView := MySlideShowWindow.View;
MyView._AddRef;
MyView.Next;
MySlideShowWindow._Release;
MyView._Release;
end;
end.