|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- #If VBA7 Or Win64 Then
- Declare PtrSafe Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As Long
- Declare PtrSafe Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
- #Else
- Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As Long
- Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
- #End If
- Dim NewTime, ss As Long
- Sub Start()
- NewTime = Now
- SetTimer 0, 0, 1000, AddressOf SavePPT
- End Sub
- Sub StopSave()
- KillTimer 0, 0
- End Sub
- Sub SavePPT()
- ss = DateDiff("s", NewTime, Now)
- If ss Mod 60 = 0 Then
- ActivePresentation.Save
- End If
- End Sub
复制代码
|
|