none
Outlook Password input Screen RRS feed

  • Question

  • Greetings

    I have a small Bed&Breakfast client that has the following situation:

    1) 5 people use the same Reception PC at all times of the day.
    2) There are programs running on the PC that require that the same user be logged in all the time (so I can not use multiple Windows Profiles)
    3) He has just upgraded to Outlook 2013 from Thunderbird
    4) Each user, when they log into their mail, gets access to their own IMAP mail account and 2 shared IMAP mail accounts


    This is what they had in Thunderbird:
    When you start up Thunderbird, it asks for your profile. Each user selects their own profile. When their profile is selected, an add-on was installed that asked for a personal password that was used to access their personal mail account. Only if the correct password was entered, would Thunderbird start up properly.

    They would like the same in Outlook

    However, you can not password protect an OST file (which would be the Home Run solution, in this case)
     
    This is not for major security protection, just simple prying eyes from other employees, all equally technophobic


    What I have set up so far:
    1) Each employee has their own mail profile setup in the Mail Control Panel program. 
    2) Each profile connects to their personal mail account and each of the two shared accounts, all filtering into their own .OST files


    Solutions I have tried:

    1) I added an empty PST file to their profile with a password on the PST file. While it did ask for a password before logging in, if they hit the "Cancel" button they would get access to all the mail accounts
    2) I tried to find a program that would password protect the OST file at the file level. Unfortunately, all the programs I seemed to find would put the file into a "vault" and there was no program the would just put up a quick password box before allowing another program to access the file
    3) I tried my hand at some "cut and Paste" VBA programming. This was the most successful as I got an almost perfect solution (A popup asks for a password, and if the right one is entered then Outlook opens, otherwise Outlook shuts down), which you can see below, except that it does not show "****" when the password is entered in the InputBox.

    My vague attempts at some VBA programming:


    Private Sub Application_Startup()
    
    Dim oProfile As Outlook.NameSpace
    
    Set oProfile = Application.GetNamespace("MAPI")
    
    Retval = InputBox("Enter password:", "Outlook Security", ,8000 , 3000)
    
    Select Case oProfile.CurrentProfileName 
    Case "1. Employee 1"
        If Retval = "password1" Then
            Exit Sub
        Else
            Application.Quit
        End If
    Case "2. Employee 2" 
        If Retval = "password2" Then
            Exit Sub
        Else
            Application.Quit
        End If
    Case "3. Employee 3"
        If Retval = "password3" Then
            Exit Sub
        Else
            Application.Quit
        End If
    Case Else
    Application.Quit
    End Select
    
    End Sub



    Like I said, this code works brilliantly and does exactly what I want.... except it shows the password when the user types it in. Now, I realise that their security is a joke, but they are not happy that anyone looking over their shoulder (which could be anyone, even guests at the B&B) can see their password.


    So then I went to go add a UserForm....

    And that is not working at all. 


    Private Sub Application_Startup()
    
    Userform1.Show
    
    End Sub



    Is how I call the Userform... but then Outlook opens before anything is typed into the form.

    And putting the Select Code On the OK button does not seem to do anything.


    Can anyone please help me to either:
    1) Implement the Select Case solution with the Userform
    2) Have any other ideas how I can give them what they want...


    Thanks

    PS. Please use detailed instructions as I am not a VBA programmer and I am just muddling around with it. Thanks you
    • Edited by Reuel Miller Tuesday, January 20, 2015 11:22 AM corrected Code display
    Tuesday, January 20, 2015 11:20 AM

Answers

  • Id the users are technophobes, remove the Outlook icon from the desktop and Start menu and add an icon to your own app that will prompt for a user name and password and launch Outlook with the specified profile (Namespace.Logon) depending on what the user specified for the credentials.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, January 20, 2015 4:26 PM

All replies

  • Hello Reuel,

    Try setting up the ShowModal property first. It will stop Outlook from loading until the form is closed.

    Anyway, there is no need to invent a wheel. You can go to the Control Panel | User Accounts and Family Safety applet. There should be the Mail section listed.

    You can see all profile and its settings. Then you can find the following window where you may choose to ask for credentials:

    It looks like you are interested in the "Always prompt for logon credentials" option.

    Tuesday, January 20, 2015 12:26 PM
  • Greetings

    > Try setting up the ShowModal property first. It will stop Outlook from loading until the form is closed.

    Private Sub Application_Startup()
    
    UserForm1.Show (modal)
    
    End Sub

    That still causes Outlook to open before a password is entered into UserForm1

    Tuesday, January 20, 2015 1:22 PM
  • > User Accounts and Family Safety applet. 

    That would be great if they used 6 different WINDOWS profiles that each had 1 OUTLOOK profile connected to it.

    Unfortunately, they have one WINDOWS profile with 6 OUTLOOK profiles that they select whenever Outlook is opened.

    Tuesday, January 20, 2015 1:25 PM
  • Private Sub Application_Startup()
    
    UserForm1.Show vbModal
    
    End Sub

    This also does not stop Outlook from opening before a password is entered.
    Tuesday, January 20, 2015 1:30 PM
  • I don't see any problem to choose a profile and enter a password. That dialog window was designed for such things.
    Tuesday, January 20, 2015 1:47 PM
  • The password can only be set on PST files.

    They use IMAP to connect to their mailboxes on a remote server. That uses an OST. Microsoft do not allow you to put a password on the OST file.

    So selecting a profile does not elicit a Password request, hence trying to do it programmatically.

    Tuesday, January 20, 2015 3:16 PM
  • The Outlook object model doesn't provide any event which may stop it from loading.
    Tuesday, January 20, 2015 3:24 PM
  • Reuel,

    In that case the only possible solution is to show a modal form with a password box.

    Tuesday, January 20, 2015 3:25 PM
  • Excellent!

    Any idea how I could implement that?  I have been muddling around but because I am not actually a VBA programmer (or any programmer, for that matter), I suspect I am missing a few crucial elements.

    There is code above that almost does exactly what I want it to do, except for hiding the input.  Once I add a UserForm to hide the input the code above does not work at all. And I do not have any idea where it might be going wrong. Any help would be greatly appreciated.

    Tuesday, January 20, 2015 3:29 PM
  • Id the users are technophobes, remove the Outlook icon from the desktop and Start menu and add an icon to your own app that will prompt for a user name and password and launch Outlook with the specified profile (Namespace.Logon) depending on what the user specified for the credentials.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, January 20, 2015 4:26 PM
  • I thought about that way. But latest OS uses the Charms bar to run the application directly. And a lot of users use the tiles.

    So the most reliable way is to display a modal form asking for password to continue working in Outlook.

    Tuesday, January 20, 2015 4:45 PM
  • That's a brilliant solution.

    So, how do I do it?

    Remember, I am not a programmer, just someone who has been cutting and pasting from examples on the internet. This is a great solution but I need some help in implementing it.

    Please

    Pretty please

    Tuesday, January 20, 2015 9:20 PM
  • The users are currently using the desktop and the desktop only. Metro is never shown.
    Tuesday, January 20, 2015 9:20 PM
  • Reuel,

    You just need to run Outlook from your application in that case. See How to automate Outlook from another program .

    Tuesday, January 20, 2015 9:25 PM