Log in

View Full Version : VBA to change the file password and save for a .ppsm file ?



Stroumpf
11-18-2013, 07:22 AM
Hi,

I have a presentation which I want to save as .ppsm
The file is protected by a password.

At the end of the presentation I have created a butto for a Macro
Now I'm searching for a VBA-code which changes the password and saves the file in current location.
My intent is that there is a sort of inital password which will be changed (overwrite) to new one and the end of the presentation, and the file is saved as and where it is
by using the button.

This is to make sure that the presentation can only be seen once.
(in the ppt there are different choices and I want to make sure not to give "second try")

Does anybody have an idea how I could solve this?

Thanks in advance!

Regards

John Wilson
11-18-2013, 07:43 AM
The code to do this is straightforward but how are you going to ensure they press the button or even enable macros??

Sub password()
ActivePresentation.password = "1234"
ActivePresentation.Save
End Sub

Stroumpf
11-18-2013, 08:08 AM
Hey, thanks for the quick help!
I've tried it out and it works quite nicely.
I'll create the "end" button it a way that, after watching the last slide, the use will feel that has to click it.
Enable the macros is an issue but I think that if if give the instruction to do so to watch the presentation, this will work.
The presentation will also possibly be used on a Mac and with OpenOffice and if I'm lucky, the check to enable the marcros or not will not be shown.

Best regards
Mark