Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

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.11 All 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



How do I call @Command([FileExport]... (Kristina Holmfo... 1.Feb.07)
. . RE: How do I call @Command([FileExp... (Alex Elliott 1.Feb.07)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow