I've been working on something lately and I needed to use SendKeys from a button in a Notes document. I kept getting the error "Illegal function call". I finally found someone with the same problem on Notes.net, and when I used WScript.Shell it worked perfectly.
The help for SendKeys says "The SendKeys statement is not legal at the module level." Could someone translate that into English for me? How is code in a button click event "at the module level"? If that's at the module level, what isn't?
Isn't this just referring to the fact that there is no SendKeys implementation in Lotusscript (despite the fact that the function is listed in its lexicon) -- hence the need for WScript?
ReplyDeleteOr am I being dim?
Nah hes used it before http://cubert-codepoet.blogspot.com/2007/12/sntt-hiding-activex-control-when-you.html
ReplyDeleteBen, I'm not sure I follow you. If there is no SendKeys implementation in Lotusscript why is it in Designer help at all? It even gives an example of using it. I have a solution to my specific problem, now I'm trying to figure out in what case the LotusScript SendKeys will ever work. I haven't found any yet.
ReplyDelete@Charles, because there was a SendKeys implementation in VIP and Improv, where Lotusscript got its start. And it's still there in the SmartSuite support. And it's useful if you're making COM calls.
ReplyDeleteBut it's the second sentence in the help...
"SendKeys is not supported on Macintosh and UNIX platforms and is not supported in Lotus Domino and Notes."
before you ask, yes, it's monumentally stupid that it's documented. But there is some logic to the fact that it doesn't work.
@Charles / Wombat: what Nathan said. See, I wasn't being dim! (there's a first). It is weird how it's there and unusable, but there is a reason for it.
ReplyDeleteWell color me clueless! Thanks for being my eyes, Nathan. I completely missed the bit about it not being supported in Notes or Domino. :-)
ReplyDeleteAny idea what we can use for doing this cross-platform?
This comment has been removed by the author.
ReplyDeleteCross platform SendKeys? Are you insane?
ReplyDeleteClosest I've heard is Java, but it might not work right everywhere:
http://forum.java.sun.com/thread.jspa?threadID=440311&messageID=1983027
Just stick with Windows old buddy.