Sunday, November 8, 2009

ArcGIS Tutorial: Password protect ArcMap Mxd


This tutorial aims at setting a custom password for your ArcMap project file. Users will be asked for a valid password ( for this tutorial set to ‘lovejesus’). On a user entering a valid password the ArcMap document will open, otherwise, an empty ArcMap instance will be opened instead. INITIAL SET-UP In a chosen folder save two ArcMap Documents. Once document should have at least a layer loaded in it (or better still a copy of one of your actual projects !!), the other file should be an empty ArcMap document: File1: . In this tutorial I’ll use ‘password protect _jesus’ File 2: . In this tutorial I’ll name it ‘myEmptyDocument’
______________________
Private Function MxDocument_OpenDocument() As Boolean Dim strPassword As String strPassword = InputBox("Enter Password", "Authenticate your Clearance") If strPassword = "lovejesus" Then MsgBox "Welcome staff member", vbOKOnly, "Clearance Authenticated" Else MsgBox ThisDocument.Title & " needs a valid Authentication to open" & _ " you will now be redirected." Application.NewDocument False, "h:\ebengiswebsite\tutorials\myEmptyDocument.mxt" End If End Function
Link the above code to a custom button and you'd do fine

No comments:

Post a Comment