PDA

View Full Version : Close presentation Userform



Rass
05-05-2014, 05:46 AM
Hi Guys :hi:

I have made a HUGE PowerPoint presentation and when i want to quit it, i have to press "Esc" alot of times because it wants me to close every single slide show that i've been in from a linked folder. Because of that i was wondering if i could make a "X" shape in the top right corner and when i press it a userform wil appear with something like "Are you sure you wanna Quit" - "Yes" and "No", is that even possible? It would save me alot of time not quitting 1 slide at a time :thumb

Thank you for takijng your time reading this.
-Rass

John Wilson
05-05-2014, 06:02 AM
If your red X runs this macro i think it would close all shows.

Sub chexClose()
If MsgBox("Do you want to quit?", vbYesNo, "Quit?") = vbYes Then
While SlideShowWindows.Count > 0
SlideShowWindows(1).View.Exit
Wend
End If
End Sub

Rass
05-05-2014, 06:24 AM
Hi John Wilson :)
To be honest, i have no idea how to make it run that macro and i have been thinking about finding a Picture on Google of a red "X" that looks a Little bit more fancy :) Can you describe a how i make it Work please? :)


Thanks for taking time so far.
-Rass

John Wilson
05-05-2014, 06:57 AM
OK

Find the image (try here) (http://www.iconsdb.com/red-icons/x-mark-3-icon.html)

I would insert it on the large slide master of the last presentation OR on the last slide

Open the last presentation (work on a COPPY!) and press ALT + f11. The vb editor should open

INSERT > Module (make sure you are using the INSERT menu in the editor not the normal insert)

Copy the code below and paste it into the editor

Sub chexClose()
If MsgBox("Do you want to quit?", vbYesNo, "Quit?") = vbYes Then
While SlideShowWindows.Count > 0
SlideShowWindows(1).View.Exit
Wend
End If
End Sub

Now go back to normal edit mode and select the red x. INSERT > Action and choose Run Macro.

Note this will only run the macro in show mode.

Save the last presentation as a macro enable presentation .pptm

TEST

If you get stuck try this as your last presentation

DOWNLOAD DEMO (http://www.pptalchemy.co.uk/Downloads/closeAll.pptm)

Rass
05-05-2014, 07:16 AM
Thanks alot, but what if i want to write "Ja" and "Nej" instead of "Yes" and "No" in the userform? Where do i change that? :)

And you're "THE MAAAAAN", i can't tell you how happy i am right now, THANKS!!

-Rass

John Wilson
05-05-2014, 07:23 AM
If you use a message box (much easier) then you are stuck with YES and NO (maybe if you change the language??)

To use a userform with custom text is a little harder and it looks like you have limited experience!

Rass
05-05-2014, 07:24 AM
So if i change the language in my Powerpoint from English to Danish it will just change it?

-Rass

John Wilson
05-05-2014, 08:01 AM
I'm really not sure. My guess is you would need a version that has the ribbon in Danish not just change the proofing language.