如何知道PPT当前状态?(100)

W

wgj

Unregistered / Unconfirmed
GUEST, unregistred user!
不通过dephi来播放ppt,而是直接用powerpoint本身来放,我的程序如何知道它现在在放映状态还是停止状态?谢谢!
 
X

xianjun

Unregistered / Unconfirmed
GUEST, unregistred user!
大概就是这样了: if PowerPointApplication1 = nil then begin PowerPointApplication1 := TPowerPointApplication.Create(Self); with PowerPointApplication1 do begin AutoConnect := False; ConnectKind := ckRunningInstance; AutoQuit := False; end; end; try PowerPointApplication1.Connect; except Caption := '请先启动PPT'; Exit; end; if PowerPointApplication1.ActivePresentation = nil then begin Caption := 'No Presentation Opened'; Exit; end; if PowerPointApplication1.ActivePresentation.SlideShowWindow = nil then begin Caption := 'No SlideShow'; Exit; end; case PowerPointApplication1.ActivePresentation.SlideShowWindow.View.State of ppSlideShowRunning: Caption := 'ppSlideShowRunning'; ppSlideShowPaused: Caption := 'ppSlideShowPaused'; ppSlideShowBlackScreen: Caption := 'ppSlideShowBlackScreen'; ppSlideShowWhiteScreen: Caption := 'ppSlideShowWhiteScreen'; ppSlideShowDone: Caption := 'ppSlideShowDone'; end;
 
Top Bottom