Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

multiple clicks

Posted on 2006-04-24
4
Medium Priority
?
187 Views
Last Modified: 2010-05-01
hello,
I have this in my VB6 form

Private Sub Command2_Click()
WebBrowser.Document.Forms("MailFormDelete").All("SelectAll").Click
WebBrowser.Document.Forms("MailFormDelete").submit
End Sub

what I would like to do is when I click on that button to keep clicking
every 5 minutes until I stop it. how can I do that?
0
Comment
Question by:aplelois
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 16531290
Add a Timer control to your Form:

Option Explicit

Private targetTime As Date

Private Sub Form_Load()
    Timer1.Enabled = False
    Timer1.Interval = 1000
    Command2.Caption = "Start"
End Sub

Private Sub Command2_Click()
    If Timer1.Enabled = False Then
        Call Click
        Command2.Caption = "Stop"
        Timer1.Enabled = True
    Else
        Timer1.Enabled = False
        Command2.Caption = "Start"
    End If
End Sub

Private Sub Click()
    WebBrowser.Document.Forms("MailFormDelete").All("SelectAll").Click
    WebBrowser.Document.Forms("MailFormDelete").submit
   
    targetTime = DateAdd("n", 5, Now())
End Sub

Private Sub Timer1_Timer()
    If Now >= targetTime Then
        Call Click
    End If
End Sub
0
 

Author Comment

by:aplelois
ID: 16531367
wow your code works amazing but im sorry I meant 5 seconds
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16531369
Change this line:

    targetTime = DateAdd("n", 5, Now())

to:

    targetTime = DateAdd("s", 5, Now())
0
 

Author Comment

by:aplelois
ID: 16531375
thank you very much!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question