Skip to main content

Password Protect your MS Outlook using macro

Yes password protect your outlook not data file. There are lot of way to password protect the data file but there is only one way to protect your Outlook is by VBA macro code.

This macro will protect your outlook from being opened. If your system is used by multiple user and you don't want anyone to access your outlook mail then VBA is the way.

Steps to follow -
1. Open outlook, go to option and select 'Trust Center Settings"
2. Under macro setting select 'Enable all macros' radio button and save the configuration.
3. Now press alt+F11 button keyboard.
4. On Left panel in project explorer expand and open 'ThisOutlookSession'.
5. Paste the below code without quote:
Private Sub Outlook_Security()
passwd = InputBox("Enter Password:", "Outlook Security")
    If Mid(passwd, 5, 1) = "#" Then
        MsgBox ("Welcome user")
        Exit Sub
    Else
        MsgBox ("Invalid Password, outlook quit")
        Application.Quit
    End If
End Sub

6. Press F5 to play/execute the above code.
7. Enter any password which contains # in 5th character.

Note: On opening Outlook, dialog box will be behind the outlook splash screen.

Comments

Popular posts from this blog

Appium: error: Couldn't start Appium REST http interface listener

Sometime it happens that Appium server doesn't start getting below error message - error: Couldn't start Appium REST http interface listener. Requested port is already in use. Please make sure there's no other instance of Appium running already. Solution: In Windows - Start Task manager > Open Processes Tab > Kill process ' node.exe ' Start the Appium server again it will resolve the issue.