VBS消息框

时间:2015-10-16 09:48:42

标签: vbscript msgbox

首先我很抱歉我对VBS非常陌生,但我正在尝试创建一个小脚本,然后在网站上完成一系列关键操作,然后转到另一个网站并完成另一系列击键。

虽然在第一个网站上我需要提出一个类似行动完成的问题。是或否。

如果否,则脚本需要返回脚本的开头。如果是,那么脚本需要继续。

稍后,在几次击键后的第二个网站上,我需要提出另一个问题天气来循环整个过程或停止。

我用谷歌搜索了一些消息框解决方案,但似乎没有用。我有

第一个问题框。

onResume()

第二个问题框。

intSerialNumber = _
        Msgbox("Was there a problem?", _
            vbYesNo, "Problem?")

    If intSerialNumber = vbYes Then
        LoopShip
    Else
        Continue
    End If  

Continue

1 个答案:

答案 0 :(得分:1)

尝试使用带有函数的嵌套循环以实现这样的可读性。用户可以根据需要多次从第一个网站重新运行代码,并可以根据需要多次从两个网站重新运行代码。

Dim problemsOccurred    
problemsOccurred = vbYes
Do
    Call firstWebsite()
    problemsOccurred = secondWebsite()
Loop Until (problemsOccurred = vbNo)


Sub firstWebsite()
    Dim firstWebsiteProblem
    firstWebsiteProblem = vbYes

    Do
        'First Website code Goes here
        firstWebsiteProblem = Msgbox("Was there a problem?", vbYesNo, "Problem?")
    Loop Until (firstWebsiteProblem = vbNo)

End Sub


Function secondWebsite()
    'Second WebSite code goes here
    secondWebsite = MsgBox("Continue Whole Process?", vbYesNo)
End Function
相关问题