Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Prompt for Notes password before continuing

Prompt for Notes password before continuing

Prompt for Notes password before continuing

Here is a helpful piece of code that I found at Notes.net (all thanks to Steve!)  This code presents the users with the Notes Login Password prompt from your application and requires a successful password before continuing.  Before you say "But they have already logged into Notes before getting to the application" here's Steve's reply to that:

And then they go off to the toilet and someone else walks up to their machine and order £20,000 of unwanted software...

So if you have any processes that you want to verify the user before continuing try this:

Dim ses As New NotesSession
Dim reg As New NotesRegistration
Dim MyID As String
Dim MyDir As String
Dim charPos As Integer

'Build the filepath to the existing ID
MyID = ses.GetEnvironmentString("KeyFilename", True)
MyDir = ses.GetEnvironmentString("Directory", True)

Dim nuserName As New NotesName(ses.UserName)
NotesUserName = nuserName.Abbreviated

charPos = Instr(1, MyID, "\")

If charPos = 0 Then ' Not found
build_str = MyDir + "\" + MyID
build_str = MyID
End If

' If the user cancels the password prompt, then an error code will be generated. The On Error statement will redirect the program execution so that the error handling code will be executed. The resume statement will then control where program execution goes when the error handling routine is completed.

' If the valid password for the current user's Notes ID is entered, then no error code will be generated and the program will continue to execute program statements in their normal sequence.

On Error Goto SomeErrorRoutine
UserName = reg.SwitchToID(build_str)

I am currently working on making this into a Script to include with all my applications where needed and will keep this post updated with any changes or improvements!



No Rows Returned

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close