Please please does anyone know how this is done?
Printable View
Please please does anyone know how this is done?
Well, if you reply here explaining what is a Crystal report, maybe I can help...
Bye,
-Jotaf98
[email protected] - ICQ#60784495 - http://jotaf98.cjb.net
Its a report created using 'Crystal Reports 7'
Here's and example directly taken (and slightly modified) from MSDN Library (look for the keywords "Shell", "AppActivate" and "SendKeys" for more info).
This one will run the Calculator, type some numbers and exit it.
So you can use this to run Crystal and edit the report or something like that!
Try creating a new project, and pasting this to the Form_Click event. It will do exactly what you told it to do when you click the form - and you can even paste the result as a proof (remember that we told it to copy the result!).Code:Dim ReturnValue, I
'This will open the calculator
ReturnValue = Shell("calc.exe", 1)
'Activate it (give focus to it so it can receive keys
'from the SendKeys command)
AppActivate ReturnValue
'Loop from 1 to 100
For I = 1 To 100
'Type the number I and press the plus sign key (+)
'Some keys must be sent in a different way, like
'this one (the plus sign between brackets)
SendKeys I & "{+}", True
Next I
'Send the equal key (to get the result)
SendKeys "=", True
'Copy the result to the clipboard (by pressing Ctrl + C)
SendKeys "^{C}", True
'Send Alt + F4 (to close it)
SendKeys "%{F4}", True
Hope that helps! Make sure you check the VB help files for more info.
Bye,
-Jotaf98
[email protected] - ICQ#60784495 - http://jotaf98.cjb.net