打开一个pps文件并停止执行,直到演出结束 [英] Open a pps file and stop execution until the show is closed
本文介绍了打开一个pps文件并停止执行,直到演出结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个access(2007)应用程序,该应用程序生成ppt并将其保存为slideshow(pps).
该工具打开pps节目供用户查看,并且必须等到用户完成观看节目后.
我的问题是如何使访问(vba代码)等到节目结束?
就像我需要捕获ppt show的关闭事件一样.
在此先感谢
问候,
Naresh S.
Hi all,
I have an access(2007) application which generates and saves a ppt as slideshow(pps).
The tool opens the pps show for user review and has to wait until user completes viewing the show.
My problem here is how to make access(vba code) to wait until the show is closed?
Like I need to capture the closing event of the ppt show.
Thanks in advance
Regards,
Naresh S.
推荐答案
您需要使用Timer
对象(以MS Access形式);)和GetObject()
函数以及API的函数: FindWindow [ ^ ]
每次经过一段时间后,MS Access都会执行Form_Timer()
过程.
抱歉,我的英语不完美!
这个想法是:在对话框模式下打开表单,并每秒检查是否打开了pps文件.
有关更多信息,请访问: http://office.microsoft.com/en-us/access-help/timer-function-HA001228923.aspx [
You need to useTimer
object (in the MS Access form) ;) andGetObject()
function and the API''s function: FindWindow[^]
MS Access will be executeForm_Timer()
procedure every time when the period of time has been passed.
Sorry, my english isn''t pefect!
The idea is: open form in dialog mode and check every second if pps file is opened.
Read more at: http://office.microsoft.com/en-us/access-help/timer-function-HA001228923.aspx[^] and in the MS Access help.
How to do it?
1) create new form
2) insert Label (Label1) on the form
2) copy and paste the code below
Option Compare Database
Option Explicit
Private Sub Form_Load()
Me.TimerInterval = 1000
End Sub
'here is the procedure where you can check if pps is opened
Private Sub Form_Timer()
'in the example we are showing only actual time ;)
Me.Label1.Caption = Now
Me.Repaint
End Sub
Set objppShowWindow = objPre.SlideShowSettings.Run.View
On Error Resume Next
Do Until objppShowWindow.State = ppSlideShowDone
If Err.Number <> 0 Then
Exit Do
Else
Sleep (1000) ''''Wait for 1 second
End If
Loop
这解决了我的问题
This solved my issue
这篇关于打开一个pps文件并停止执行,直到演出结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文