ActivePresentation.SlideShowSettings.Run
With UserForm1
.StartUpPosition = 0
.Top = 0
.Left = 600
.Show False
End With
End Sub
窗体代码:
Option Explicit
Dim r As Long
Dim num As Long
Private Sub UserForm_Click()
Randomize (Time)
num = ActivePresentation.Slides.Count
r = Int(Rnd() * num) + 1
'Presentations(1).Slides(r).Copy
' SlideShowWindows(Index:=1).View.GotoSlide r, msoTrue
'Presentations(1).Slides(r).MoveTo 1
SlideShowWindows(Index:=1).View.GotoSlide r, msoTrue
DoEvents
End Sub
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
UserForm_Click
End Sub
Private Sub UserForm_Terminate()
On Error Resume Next 'esc
SlideShowWindows(Index:=1).View.GotoSlide 1
DoEvents
SlideShowWindows(Index:=1).View.Exit
End Sub
Option Explicit
Sub Macro1()
'
ActivePresentation.SlideShowSettings.Run
With UserForm1
.StartUpPosition = 0
.Top = 0
.Left = 600
.Show False
End With
End Sub
窗体代码:
Option Explicit
Dim r As Long
Dim num As Long
Private Sub UserForm_Click()
Randomize (Time)
num = ActivePresentation.Slides.Count
r = Int(Rnd() * num) + 1
'Presentations(1).Slides(r).Copy
' SlideShowWindows(Index:=1).View.GotoSlide r, msoTrue
'Presentations(1).Slides(r).MoveTo 1
SlideShowWindows(Index:=1).View.GotoSlide r, msoTrue
DoEvents
End Sub
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
UserForm_Click
End Sub
Private Sub UserForm_Terminate()
On Error Resume Next 'esc
SlideShowWindows(Index:=1).View.GotoSlide 1
DoEvents
SlideShowWindows(Index:=1).View.Exit
End Sub
39 KB, 下载次数: 103)