ToolsUserLogoff in Lotus Script

I am having an application with approval process and when the user clicks on the button in the form it should prompt for the notes password.

I know we can do this in forumla by

@command(ToolsUserLogoff). I am trying to do the same in lotus script and i did find a code for simulating F5 function for the older versions of Notes. Now the private user clear information is done by CTRL+F5. Does any one have an updated code for this functionality in LotusScript.

Here is the link to the code for doing F5 in Lotusscript for earlier version of notes

http://www.eknori.de/2004-10-09/commandtoolsuserlogoff-in-lotus-script/

Subject: Your example modified…

Try this with a newer Notes Client:

Const VK_MENU = &H12 'Alt key

Const VK_F = &H46 ’ “F” key

Const VK_T = &H54 ’ “T” key

Const VK_I = &H49 ’ “I” key

Const KEYEVENTF_KEYDOWN = &H0000

Const KEYEVENTF_KEYUP = &H0002

Declare Sub WIN32_KeyBoardEvent Lib “User32” Alias “keybd_event” ( Byval bVirtualKey As Integer , Byval bScanCode As Integer , dwFlags As Long , dwExtraInfo As Long )

Sub Click(Source As Button)

Call Logoff

End Sub

Sub Logoff ( )

Dim ModuleName As String

ModuleName = {Logoff}

On Error Goto ErrorHandler



WIN32_KeyBoardEvent VK_MENU , 0 , KEYEVENTF_KEYDOWN , 0

'------

WIN32_KeyBoardEvent VK_F , 0 , KEYEVENTF_KEYDOWN , 0

WIN32_KeyBoardEvent VK_F , 0 , KEYEVENTF_KEYUP , 0

WIN32_KeyBoardEvent VK_T , 0 , KEYEVENTF_KEYDOWN , 0

WIN32_KeyBoardEvent VK_T , 0 , KEYEVENTF_KEYUP , 0

WIN32_KeyBoardEvent VK_I , 0 , KEYEVENTF_KEYDOWN , 0

WIN32_KeyBoardEvent VK_I , 0 , KEYEVENTF_KEYUP , 0

'------

WIN32_KeyBoardEvent VK_MENU , 0 , KEYEVENTF_KEYUP , 0

Exit Sub

ErrorHandler:

Select Case fnErrorHandler ( Error$ , Err , Erl , ModuleName )

Case 0

	Exit Sub

Case 1

	Resume Next

Case Else

	Resume Next

End Select

End Sub

Here’s a link where I found Virtual Key code listings (maybe not the best):

HTH

Geoff-

Subject: Example not working

Hi Geoff,

Thanks for your response, i tried to your code and nothing happens. Any help would be appreciated.

Thanks