在Visual Basic中创建一个每30秒执行一次的定时循环

时间:2011-02-16 11:19:36

标签: vbscript timer

我需要下面的代码每隔30秒执行一次,持续9分钟才能继续前进。有任何想法吗?

'Begin 9 minute loop

CLEAR CONTENTS
Dim newFIle
Set FSO = CreateObject("Scripting.FileSystemObject")
Set newFIle = FSO.CreateTextFile("C:\Users\Owner\Desktop\RECALL\OutlookExport.csv", True, False)
newFIle.Write "Need Data"
newFIle.Close

Set FSO = CreateObject("Scripting.FileSystemObject")
'Choose File
Set csvOut = FSO.OpenTextFile("C:\Users\Owner\Desktop\RECALL\OutlookExport.csv", 8, True)
'Export Messages
For Each email In inbox.Folders.Item(CInt(response)).Items
    csvOut.Write (Chr(34) & email.SenderName & Chr(34) & ",")
    csvOut.Write email.Body
    csvOut.Write (vbNewLine)
Next

'Pause 30 seconds
'Return to "Begin 9 Minute Loop
'Repeat 18 times
'End 9 minute loop (Execute remainder of code)

1 个答案:

答案 0 :(得分:0)