Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-01-2013, 11:21 AM
GerryM GerryM is offline Power Point & Visual Basic Load Events Windows XP Power Point & Visual Basic Load Events Office 2007
Novice
Power Point & Visual Basic Load Events
 
Join Date: Sep 2013
Posts: 3
GerryM is on a distinguished road
Default Power Point & Visual Basic Load Events


I have created a slide show and one of the main tasks is to ask the user questions and then have them press a true or false button(s) to see the answer or explanation.

The issue I have is that once a button is selected the resulting textbox value holds that result, so when I re-start the show instead of having a blank textbox it now has the last entered result.

I need to figure out how to do run a routine that will set all my objects to their intended state either upon starting the slide show or when a slide becomes active. In visual basic there is a form Load routine that does this, however in Power Point there is no form load or Slide load event

Help..
Reply With Quote
  #2  
Old 09-01-2013, 12:42 PM
JohnWilson JohnWilson is offline Power Point & Visual Basic Load Events Windows 7 64bit Power Point & Visual Basic Load Events Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

There are no similar events in PowerPoint. You would really need to write a with events class but this isn't simple and difficult to make work outside of an AddIn. IF you are accessing vba during the show (sounds like it) then there is a solution.

Sub OnSlideShowTerminate(ByVal Wn As SlideShowWindow)
Dim osld As Slide
Dim opres As Presentation
Set opres = ActivePresentation
For Each osld In opres.Slides
' insert code here to clear textbox
On Error Resume Next
' will depend whether it's an ActivX box or a normal textbox
'for ActivX
osld.Shapes("TextBox1").OLEFormat.Object.Text = "" ' use actual name of course
'normal shape
osld.Shapes("name of shape").TextFrame.DeleteText
Next osld
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 09-01-2013, 09:34 PM
GerryM GerryM is offline Power Point & Visual Basic Load Events Windows XP Power Point & Visual Basic Load Events Office 2007
Novice
Power Point & Visual Basic Load Events
 
Join Date: Sep 2013
Posts: 3
GerryM is on a distinguished road
Smile Thanks John

I will give this a shot.. Thank you for your help

Quote:
Originally Posted by JohnWilson View Post
There are no similar events in PowerPoint. You would really need to write a with events class but this isn't simple and difficult to make work outside of an AddIn. IF you are accessing vba during the show (sounds like it) then there is a solution.

Sub OnSlideShowTerminate(ByVal Wn As SlideShowWindow)
Dim osld As Slide
Dim opres As Presentation
Set opres = ActivePresentation
For Each osld In opres.Slides
' insert code here to clear textbox
On Error Resume Next
' will depend whether it's an ActivX box or a normal textbox
'for ActivX
osld.Shapes("TextBox1").OLEFormat.Object.Text = "" ' use actual name of course
'normal shape
osld.Shapes("name of shape").TextFrame.DeleteText
Next osld
End Sub
Reply With Quote
  #4  
Old 09-01-2013, 09:34 PM
GerryM GerryM is offline Power Point & Visual Basic Load Events Windows XP Power Point & Visual Basic Load Events Office 2007
Novice
Power Point & Visual Basic Load Events
 
Join Date: Sep 2013
Posts: 3
GerryM is on a distinguished road
Default

Thank you I will give it a try
Reply With Quote
  #5  
Old 03-12-2022, 05:07 AM
boaz boaz is offline Power Point & Visual Basic Load Events Windows 11 Power Point & Visual Basic Load Events Office 2021
Novice
 
Join Date: Mar 2022
Posts: 1
boaz is on a distinguished road
Default

Quote:
Originally Posted by GerryM View Post
I will give this a shot.. Thank you for your help
Hi
I'm using the OnSlideShowTerminate event and it is working well if I stop the presentation in the middle but if it ends (after the last slide) I don't get it to work, any ideas?
Reply With Quote
  #6  
Old 03-12-2022, 06:07 AM
JohnWilson JohnWilson is offline Power Point & Visual Basic Load Events Windows 10 Power Point & Visual Basic Load Events Office 2019
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

It should still run OK. so I don't know what the problem is.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to break Links to FIles in visual basic? Asinkan PowerPoint 0 11-15-2012 03:08 AM
Visual Basic Editor changes from 2003 to 2007 Rockitman31 Word VBA 4 09-21-2011 12:01 PM
Microsoft Power Point 2004 to Office Power Point 2007 chuff PowerPoint 0 03-20-2011 01:23 PM
Referencing Tables in Visual Basic Editor DavidB Word Tables 0 09-21-2009 04:01 PM
Power Point & Visual Basic Load Events A little Visual Basic Help Please leroytrolley Excel 4 08-22-2008 03:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft