Close Lotus Notes Client through LotusScript?

I wanted to know if you can close the Lotus Notes client through LotusScript.

I know there is @Command([FileExit]) and @Command([ExitNotes]), however, the cross-reference is to the NotesUIDatabase method Close.

I have tried the Close method, but it only closes the current database - it does not close the client.it just seems to pay no attention to it…

I tried Evaluate(“@Command([FileExit])”), but

Any ideas?

Thanks!

Dan

Subject: Close Lotus Notes Client through LotusScript?

Why don’t you put the @Command([FileExit]) in an agent, and run the agent from within LotusScript?

(I did not test this myself …)

Subject: Close Lotus Notes Client through LotusScript?

You can create an empty form with the formula @Command([FileExit]) in its PostOpen event. In your LotusScript code, use workspace.ComposeDocument to compose a document using this form. The new document immediately closes the client.

Subject: RE: Close Lotus Notes Client through LotusScript?

Now that’s seriously clever workaround!!

Subject: Close Lotus Notes Client through LotusScript?

I have been using the code below. Found it on Notes Forum some month ago. :-))

[Declarations]

Declare Sub keybd_event Lib “user32.dll” (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer,Byval dwExtraInfo As Integer)

Sub Initialize

keybd_event 18,0,0,0 ' Alt key down

keybd_event 70,0,0,0 ' F key down

keybd_event 70,0,2,0 ' F key up

keybd_event 18,0,2,0 ' Alt key up 

keybd_event 88,0,0,0 ' X key down

keybd_event 88,0,2,0 ' X key up 

End Sub

regards

Bjarne Hoeg

Subject: Nice tip. In Lotus Notes 8 you should use ALT+f4+enter instead

Nice tip Bjarne Hoeg.

Just take note: In Lotus Notes 8 you should use ALT+f4+enter instead:

[Declarations]

Declare Sub keybd_event Lib “user32.dll” (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer,Byval dwExtraInfo As Integer)

Sub Initialize

keybd_event 18,0,0,0 ' Alt down

keybd_event 115,0,0,0 ' F4 down

keybd_event 115,0,2,0 ' F4 up

keybd_event 18,0,2,0 ' Alt up	

keybd_event 13,0,0,0 ' enter up

keybd_event 13,0,2,0 ' enter down

End Sub

Subject: RE: Close Lotus Notes Client through LotusScript?

Worked perfectly!

Thanks!

Dan