E
eldon.l.lehman
Reference: previous post entitled: How to stop a macro on
SlideShowNextSlide event? by Brian ORielly April 2001
I would like to place a shape on slide1(action setting>run macro
"ExitStrategy()") and have it stop a running macro(action setting.run
macro "YourCurrentCode()") when the screen shows the desired color for
another shape on slide1.
Apparently the suggested code in this example is not correctly placed
in my code. Could you point me to the error?
Windows XP
PPT 2003
begin code ------
Public blnFlagExit As Boolean
Public pres As Presentation
Public oSld As Slide
Sub YourCurrentCode()
Set pres = ActivePresentation
Set oSld = pres.Slides(1)
Dim blnFlagExit As Boolean
blnFlagExit = False
'Does what it does and
'the following is in the code
'Works best inside a loop since it's visited
'frequently
Dim n As Integer
Do While n < 255
oSld.Shapes("Arm").Fill.ForeColor.RGB = RGB(n, 0, 0)
If blnFlagExit = True Then
Exit Sub
End If
SlideShowWindows(1).View.GotoSlide 1
'Rest of your code
n = n + 1
Loop
MsgBox "At the finish is equal to " & n
End Sub
Sub ExitStrategy()
'Attach this to a full frame no fill shape OnClick action
blnFlagExit = True
End Sub
end code ----
Thank you,
Eldon
SlideShowNextSlide event? by Brian ORielly April 2001
I would like to place a shape on slide1(action setting>run macro
"ExitStrategy()") and have it stop a running macro(action setting.run
macro "YourCurrentCode()") when the screen shows the desired color for
another shape on slide1.
Apparently the suggested code in this example is not correctly placed
in my code. Could you point me to the error?
Windows XP
PPT 2003
begin code ------
Public blnFlagExit As Boolean
Public pres As Presentation
Public oSld As Slide
Sub YourCurrentCode()
Set pres = ActivePresentation
Set oSld = pres.Slides(1)
Dim blnFlagExit As Boolean
blnFlagExit = False
'Does what it does and
'the following is in the code
'Works best inside a loop since it's visited
'frequently
Dim n As Integer
Do While n < 255
oSld.Shapes("Arm").Fill.ForeColor.RGB = RGB(n, 0, 0)
If blnFlagExit = True Then
Exit Sub
End If
SlideShowWindows(1).View.GotoSlide 1
'Rest of your code
n = n + 1
Loop
MsgBox "At the finish is equal to " & n
End Sub
Sub ExitStrategy()
'Attach this to a full frame no fill shape OnClick action
blnFlagExit = True
End Sub
end code ----
Thank you,
Eldon