Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendKeys

Status
Not open for further replies.

clegg

Programmer
Jan 25, 2001
98
GB
Hi!

Does anyone know of an equivalent function (or other method) in COBOL (i'm using NetExpress 3.0) for the SendKeys function in VB?

Many thanks

Clegg
 
If you really want to use sendkeys, you could create a windows scripting host object in your COBOL and feed it a sendkeys script created by your COBOL program. Other folks have had success (albeit ugly success) by using the SendMessage API to accomplish the same thing in a more controlled way.

Generally, I try to avoid SendKeys especially in a production environment. It relies too much on having the target window active and also has some timing-related problems.

Regards.

Glenn
 
The only reason I want to use a SendKeys type function is so that the user doesn't have to press on the OK button when a mailmerge is done through my OLE program.

This doesn't appear to be a problem on Office XP, when I execute the mailmerge it just does it. However on earlier versions of Office the print dialog box stays on the screen waiting for input - i just wanted to avoid the user having to sit watching the machine whilst it cycles through merging.

Regards

Clegg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top