Hello ,
i want to print a document “current document” using lotus script, i want to print it landscape , and uidoc.print doesn’t provide this ability , and also i have tried lots of scripts that send key board keys
Hello ,
i want to print a document “current document” using lotus script, i want to print it landscape , and uidoc.print doesn’t provide this ability , and also i have tried lots of scripts that send key board keys
Subject: Print using lotus scripy
Is this what you have tried? (It is an excerpt from a technote: # 1087073)
The Microsoft® Windows™ operating system contains a keyboard subroutine which can be used to mimic the key strokes necessary to set the printer (File → Print → N, which selects the Printer button. The KeyBd_Event subroutine is present within the user32.dll file. This applies to the Print dialog box and menus that appear in Notes 6.0 and later releases.
NOTE: The code cannot be placed in an agent triggered by a menu.
For additional details refer to (Document 1089151), “How to simulate user keyboard events in LotusScript without using SendKeys (user32.dll).”
Workaround:
The following code (to be attached to a button) performs the keystrokes, ALT+F, SHIFT+TAB, Right arrow, ALT+A, ENTER. This brings up the Print dialog box, switches to the Page Setup tab, and selects Landscape orientation.
NOTE: The code below is a sample script provided to illustrate one way to approach this issue. It is to be used as is and at your own risk. In order for this example to perform as intended, the script must be laid out exactly as indicated below. Product Support cannot customize this script for specific environments or applications.
(declarations)
'The code below should be entered as one line:
Declare Sub keybd_event Lib “user32.dll” (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer, Byval dwExtraInfo As Integer)
Sub Click(Source As Button)
keybd_event 18,0,0,0 ’ Alt down
keybd_event 70,0,0,0 ’ F down
keybd_event 70,0,2,0 ’ F up
keybd_event 80,0,0,0 ’ P down
keybd_event 80,0,2,0 ’ P up
keybd_event 18,0,2,0 ’ Alt up
keybd_event 16,0,0,0 ’ shift down
keybd_event 9,0,0,0 ’ tab down
keybd_event 9,0,2,0 ’ tab up
keybd_event 16,0,2,0 ’ shift key up
keybd_event 39,0,0,0 ’ RightArrow key down
keybd_event 39,0,2,0 ’ RightArrow key up
keybd_event 18,0,0,0 ’ Alt down
keybd_event 65,0,0,0 ’ A key down
keybd_event 65,0,2,0 ’ A key up
keybd_event 18,0,2,0 ’ Alt up
keybd_event 13,0,0,0 ’ enter key down
keybd_event 13,0,2,0 ’ enter key up
End Sub
In Notes releases prior to 6.0 and in certain 6.x releases, the print orientation setting does not hold. For additional details about this issue, refer to Document 1097167, “Notes keeps Landscape print setting only during current session; reverts to portrait with restart.”
Subject: RE: Print using lotus scripy
i have tried the code , but it opens the file menu only , i am using by the way windows XP and Notes 8