closing a presentation opened from a userform

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.
 
S

Shyam Pillai

How exactly do you want the code to work? It appears that the presentation
is launched and then the userform is unloaded.
 
G

Guest

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?
 
B

barn2003

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top