dbTalk Databases Forums  

send keys problem/ Pdx 8

comp.databases.paradox comp.databases.paradox


Discuss send keys problem/ Pdx 8 in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hilary
 
Posts: n/a

Default send keys problem/ Pdx 8 - 06-24-2003 , 11:18 AM






I have a push button on a form that creates a query and calls a report
that needs to print to a label printer. I need to modify the Printer
Properties to change paper size and orientation. I have found that
sendkeys is the only way to effectively to do this. When I run the
form and push the button the code stops when I call:
rHandle.menuaction(MenuFilePrint)
Any code after that does not execute until I close the Print Menu. How
can I send sendkeys() to the Print Menu?

Any help would GREATLY be appreciated.



if NOT rHandle.open(strReportName) then
msgStop("Error opening " + strReportName, "Please make sure the report
exists and try again.")
endIf
else msgstop ("No Data" , "There are no labels to print for account.")
endif

rHandle.menuaction(MenuFilePrint)
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("%(O)") ;Go to Properties
sendkeys ("%(D)") ;Change to Default paper size
sendkeys ("%(L)") ;Change to Landscape orientation
sendkeys ("%(A)") ;Apply

Reply With Quote
  #2  
Old   
Liz
 
Posts: n/a

Default Re: send keys problem/ Pdx 8 - 06-24-2003 , 12:22 PM






You have to put all those commands in one sendKeys() line and set the
logical flag to False (I think, if it doesn't work, try True) (see
ObjectPAL help for the full syntax) and put the sendKeys() line
_before_ the line which opens the print dialog.

Liz


Hilary wrote:
Quote:
I have a push button on a form that creates a query and calls a report
that needs to print to a label printer. I need to modify the Printer
Properties to change paper size and orientation. I have found that
sendkeys is the only way to effectively to do this. When I run the
form and push the button the code stops when I call:
rHandle.menuaction(MenuFilePrint)
Any code after that does not execute until I close the Print Menu. How
can I send sendkeys() to the Print Menu?

Any help would GREATLY be appreciated.

if NOT rHandle.open(strReportName) then
msgStop("Error opening " + strReportName, "Please make sure the report
exists and try again.")
endIf
else msgstop ("No Data" , "There are no labels to print for account.")
endif

rHandle.menuaction(MenuFilePrint)
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("{tab}")
sendkeys ("%(O)") ;Go to Properties
sendkeys ("%(D)") ;Change to Default paper size
sendkeys ("%(L)") ;Change to Landscape orientation
sendkeys ("%(A)") ;Apply

Reply With Quote
  #3  
Old   
Hilary
 
Posts: n/a

Default Re: send keys problem/ Pdx 8 - 06-25-2003 , 07:23 AM



Thanks Liz, I have it working now.

Just a note for anyone else who needs to do this. At least in my case
with Pdx8 and Win 98, I could not start the send keys with {tab}
because for some reason it changes it from printing "Full File" to
printing "Page Range" 1 to 1. This is the only way I got it to go to
properties screen and keep "Full File" toggled on.


sendkeys ("%(n),{tab},{tab},%(o),%(d),%(l),{tab},{tab},{tab },{tab},{tab},{tab},{enter}",false)
rHandle.menuaction(MenuFilePrint)

Hilary

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.