only allow user to open presentation if Environ("username") matches a whitelist

N

nethack.addict

This is a question for the powerpoint VBA gurus among you:

I have a presentation that I only want viewable by certain
usernames--specifically, users whose Environ("username") matches a list
that I specify.

For example, suppose that I decide only the username "john" is allowed
to view my presentation. Then the ideal sequence of events would be:
- User opens presentation
- VBA checks to see if Environ("username") = "john"
- If yes, the user is allowed to view the presentation; if no, they are
given some kind of warning and/or the presentation closes.

This solution does not need to be uncrackable, just inconvenient for
any unauthorized users that "john" might forward this presentation to.

Things I've tried so far:

- Covering the content of each slide of the presentation with a
rectangle named "blocker", asking the user to click a commandbutton on
the first page, which triggers code that deletes the "blocker" shapes
only if Environ("username") = "john"
+ problem: doesn't work if I save the file as read-only
+ problem: clicking on commandbutton on first slide seems to hang
the presentation

- Trapping the event corresponding to the opening of the presentation,
doing the username check then, and closing the file if the user isn't
on the authorized list
+ Problem: there's no built-in "auto_open" event in powerpoint. You
can work around this using an add-in, but I don't want the user to have
to install an add-in to view this presentation.

The good news is that Environ("username") returns the right data. So I
just need to figure out how to limit access to the presentation based
on this data ... would be most grateful for any expert advice!
 
B

Bill Dilworth

You seem to have hit most of the reasons I scrapped a security feature
add-in I tried to develop a few years ago.

Have you thought of using something like SharePoint?


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
W

wizardofyendor

Drat, I was hoping for a simple, lightweight VBA solution ... but I
guess if an MVP tells me it can't be done, it can't be done :/

Maybe the silver lining is that this approach would be really easy to
implement in Excel :)
 
B

Bill Dilworth

LOL -- I've been known to be off on one or two things in the past. Someone
may offer a different opinion on this problem. The only other option I
could think of off the top of my head is a password to open the file and a
different one to modify. People 'on the list' are given the open password,
but not the modify one. I know, I know. The solution sucks only slightly
less than the problem. Oh well.

With excel, you gain the ability to auto_run code on an opening workbook (if
the security is set low enough), but I still don't think you can change a
read-only file.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
J

John Wilson

Maybe this is way off too but at least its something to think about!

Add a blocking shape to all slides with a with previous exit so the slides
cant be read in edit mode.

Use a modify password to make read only and save in kiosk mode to prevent
keyboard etc being used

Navigation is now only by action buttons, use vba to make .visible = false
for all buttons and a button on slide one which makes them all visible if
username = list


--
___________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk
 

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