I have some code to send some numbers to the calculator (aprt of a sample).
Its in a loop
SENDKEYS I "{+}", TRUE
I get the error message:
Expected variable or Procedure not Project.
Anybody able to help?
08-05-2003 at 01:45 PM
|
steve_w Level: Moderator Registered: 18-04-2003 Posts: 1156
Re: SENDKEYS error
Any chance of posting a bit more of the code up there please?
PS I assume the syntax error was accidental.
The following code worked for me. I put the calc.exe as the foreground app and the vb code put the values into the calculator.
Private Sub Timer1_Timer()
Dim i As Integer
For i = 1 To 20
SendKeys i & "{+}", True
Next i
End Sub
[Edited by steve_w on 08-05-2003 at 03:23 PM GMT]
08-05-2003 at 02:48 PM
|
Elderon Level: Guest
Re: SENDKEYS error
Hi -
thanks for your reply - the syntax error was a mistake. he code is from the help and gives me the error as stated even with the correct syntax.
What I'm trying to do (this may not be the way to do it), is to automate the sending of e-mails based on a timer object.
Thus the app will have data fed into it and then at periodic intervals it will automaticalyy send emails in the format
<standard text><variable text from table><standard text>
I wish to use Outlook as my e-mail sender and receiver. Dont want masses of code. I have been todl that it might be better to use another method but am not aware of one thats easy.
12-05-2003 at 01:04 PM
|
steve_w Level: Moderator Registered: 18-04-2003 Posts: 1156
Re: SENDKEYS error
You could try using the mapi controls instead of using the sendkeys.
Select the Microsoft MAPI Controls 6.0 from the Components screen (Ctrl - T)
This will give you two controls MapiSession and MapiMessage. Put both of these onto your form. Then use the following code.