RE: How do I call @Command([FileExport]) from within LotusScript? Alex Elliott 1.Feb.07 05:22 PM a Web browser Domino Designer -- LotusScript 5.0.11All Platforms
Perhaps you could 'Send' the keys through the keyboard to bring up the Export dialog box. Here's an excerpt from the Lotus Notes Knowledge Base:
======================
Problem
In Lotus Domino®'s LotusScript, you can perform simple keyboard shortcuts, such as:
-- Selecting all documents in the current view [CTRL+A] or [ALT+E, A]
-- Deselecting all documents in the current view [ALT+E, D]
-- Using the browser's Go Back action [ALT+LEFTARROW]
-- Using the browser's Go Forward action [ALT+RIGHTARROW]
The LotusScript SendKeys statement is not supported in Notes/Domino. Is there another method for sending keystroke commands to Notes?
Solution
The Microsoft Windows user32.dll library can be used to simulate keyboard events at the operating system level.
NOTE: The information below is offered as an example only. Further modifications and examples cannot be provided by Product Support.
In the Keybd_event subroutine:
-- The first parameter defines the key to be simulated.
-- The third parameter defines the action (0 = keyDown, 2 = keyUp).
-- The second and forth parameter are given a value of 0 since they are not used in this case.
The example below simulates the [ALT_LEFTARROW] keystroke that corresponds to the browser's Go Back action. To simulate [ALT+LEFTARROW], four keyboard events must be used:
-- Press ALT
-- Press LEFTARROW
-- Release LEFT ARROW
-- Release ALT
In order to do this with LotusScript, do the following:
-- In the Declarations section of your Action/Button, the following code defines the subroutine that is implemented in the .dll:
Declare Sub keybd_event Lib "user32.dll" (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer, Byval dwExtraInfo As Integer)
-- In the Click section of your Action/Button, the following code calls the subroutine:
keybd_event 18,0,0,0 ' Alt key down
keybd_event 37,0,0,0 ' LeftArrow key down
keybd_event 37,0,2,0 ' LeftArrow key up
keybd_event 18,0,2,0 ' Alt key up
In the same way, replacing the LEFTARROW code of 37 by the RIGHTARROW code of 39 simulates the [ALT_RIGHTARROW] keystroke that corresponds to the browser's Go Forward action.
keybd_event 18,0,0,0 ' Alt key down
keybd_event 39,0,0,0 ' RightArrow key down
keybd_event 39,0,2,0 ' RightArrow key up
keybd_event 18,0,2,0 ' Alt key up
In order to simulate Select All [ALT+E, A], use the following code, where ALT is 18, E is 69, and A is 65:
keybd_event 18,0,0,0 ' Alt key down
keybd_event 69,0,0,0 ' E down
keybd_event 69,0,2,0 ' E up
keybd_event 18,0,2,0 ' Alt key up
keybd_event 65,0,0,0 ' A down
keybd_event 65,0,2,0 ' A up
In order to simulate Deselect All [ALT+E, D], use the following, where ALT is 18, E is 69, and D is 68:
keybd_event 18,0,0,0 ' Alt key down
keybd_event 69,0,0,0 ' E down
keybd_event 69,0,2,0 ' E up
keybd_event 18,0,2,0 ' Alt key up
keybd_event 68,0,0,0 ' D down
keybd_event 68,0,2,0 ' D up
Some helpful key-defining codes are:
9
Tab
13
Enter
16
Shift
17
CTRL
18
ALT
37
LeftArrow
38
UpArrow
39
RightArrow
40
DownArrow
65..90
A..Z