outlook vba question

Associate
Joined
8 Mar 2007
Posts
2,176
Location
between here and there
hello to all,

I'm trying to open a powerpoint slide show from outlook. I've managed to save the attachment and open/start the slideshow ok, but I'm having trouble finishing it.

below is my code. I get an object not defined error on the red line. Idealy I need it start the slideshow and then keep looping the whole thing untill outlook receievs another email with a certain subject.

Most of this i can handle but It's getting the slideshow to keep looping that I'm stuck on.


Code:
Sub open_march_maddness_file()

    
    'MsgBox "openning new ppt file"


    Set objPPT = CreateObject("PowerPoint.Application")
    objPPT.Visible = True

    Set objPresentation = objPPT.Presentations.Open("C:\march madness\March.ppt")
    

    objPresentation.SlideShowSettings.StartingSlide = 1
    objPresentation.SlideShowSettings.EndingSlide = objPresentation.Slides.Count
    objPresentation.SlideShowSettings.LoopUntilStopped = msoTrue
    objPresentation.Slides.Range.SlideShowTransition.AdvanceOnTime = True
    objPresentation.Slides.Range.SlideShowTransition.AdvanceTime = 10
      
      
   
   Set objslideshow.State = objPresentation.SlideShowSettings.Run.View - SHOULD BE IN RED !!!!!
   
   Do Until objslideshow.State = ppSlideShowDone
   
    If Err <> 0 Then
        Exit Do
    End If
    Loop
    
    objPresentation.Saved = True
    objPresentation.Close objPPT.Quit
 

End Sub

any ideas???

cheers guys
 
Back
Top Bottom