@Command([ToolsUserLogoff]) in Lotus Script

Mit Hilfe der Windows API kann der Befehl @Command([ToolsUserLogoff]) in Lotus Script simuliert werden.

VK_F5 = &H74
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 Logoff ( )
  Dim ModuleName As String
  ModuleName = {Logoff}
  On Error Goto ErrorHandler

  WIN32_KeyBoardEvent VK_F5 , 0 , KEYEVENTF_KEYDOWN , 0
  WIN32_KeyBoardEvent VK_F5 , 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

Function fnErrorHandler ( strErrorText As String , lngErrorNumber As Long , lngErrorLine As Long , strModuleName As String ) As Integer
Print ( {ERROR: } + strErrorText + { (Nr.: } + Cstr (lngErrorNumber ) + {, Line: } + Cstr (lngErrorLine ) + {, Module: } + strModuleName + {)} )
fnErrorHandler = 1
End Function

Und zum Testen folgender Aufruf

Sub Click(Source As Button)
  Call Logoff
End Sub 

One thought on “@Command([ToolsUserLogoff]) in Lotus Script

Comments are closed.