closing a presentation opened from a userform

  • Thread starter Thread starter barn2003@hotmail
  • Start date Start date
B

barn2003@hotmail

hi

I having problems closing a presentation opened from a
userform in a parent presentation. I use the following
code on the command button.

Private Sub CommandButton2_Click()
Dim templink2 As String
templink2 = "" & ActivePresentation.Path
& "\testtemp2.ppt"
With Presentations.Open(templink2).SlideShowSettings
.Run (ppSlideShowFullScreen)
End With
Unload Me
End Sub

When an a button with 'end show' action is clicked in the
child presentation. The child presentation appears back
in powerpoint slide editing mode. I need it to close
altogether show the parent presentation which is still
active.
 
How exactly do you want the code to work? It appears that the presentation
is launched and then the userform is unloaded.
 
hi

Code on command button launched by userform opened in
parent presentation:

Private Sub CommandButton2_Click()
Dim templink2 As String
templink2 = "" & ActivePresentation.Path
& "\testtemp2.ppt"
With Presentations.Open(templink2).SlideShowSettings
.Run (ppSlideShowFullScreen)
End With
Unload Me
End Sub

This loads the child presentation from the user form.
I use 'unload me' to get rid of the menu form which is no
longer needed.

I managed to find a solution but it appears a bit bodgy.

This sub is in the child:


Sub closewithnosave()
Dim tlink As String
tlink = "C:\Documents and Settings\bjm\My
Documents\proj_bmt\presentations_nu\send_v4\testtemp2.ppt"
With Application.Presentations(tlink)
.Saved = True
.Close
End With

ActivePresentation.SlideShowWindow.View.Exit

'calls sub in parent presentation (see below)

Call Application.Run("C:\Documents and Settings\bjm\My
Documents\proj_bmt\presentations_nu\send_v4
\BMT_DSL_v4_4.ppt!GoBackandRun")

End Sub


This in the parent:


Sub GoBackandRun()
ActivePresentation.SlideShowSettings.Run
End Sub


this exits the child presentation and closes it without
saving then runs th eparent slideshow again. Is there a
better way?
 
hi

appears it does work if I relaunch the menu (which is a
user userform) from the presentation once i done once
already.

Is there an add-in available or a tutoriual somewhere
which might help me out?
 
Back
Top