我们需要完成下面一系列操作
Window("Text:=HyperSna").WinButton("Caption:=日期").Click
Window("Text:=HyperSna").WinButton("Caption:=时间").Click
Window("Text:=HyperSna").WinButton("Caption:=确定").Click
为了方便其见,我们可以将Window("Text:=HyperSna")赋值到一个变量,然后再使用
参见下面的代码
Set WinHyper = Window("Text:=HyperSna")
WinHyper.WinButton("Caption:=日期").Click
WinHyper.WinButton("Caption:=时间").Click
WinHyper.WinButton("Caption:=确定").Click
如果使用了VBScript里面的With语句,还可以简化为以下代码
With Window("Text:=HyperSna")
.WinButton("Caption:=日期").Click
.WinButton("Caption:=时间").Click
.WinButton("Caption:=确定").Click
End With
Window("Text:=HyperSna").WinButton("Caption:=日期").Click
Window("Text:=HyperSna").WinButton("Caption:=时间").Click
Window("Text:=HyperSna").WinButton("Caption:=确定").Click
为了方便其见,我们可以将Window("Text:=HyperSna")赋值到一个变量,然后再使用
参见下面的代码
Set WinHyper = Window("Text:=HyperSna")
WinHyper.WinButton("Caption:=日期").Click
WinHyper.WinButton("Caption:=时间").Click
WinHyper.WinButton("Caption:=确定").Click
如果使用了VBScript里面的With语句,还可以简化为以下代码
With Window("Text:=HyperSna")
.WinButton("Caption:=日期").Click
.WinButton("Caption:=时间").Click
.WinButton("Caption:=确定").Click
End With
150

被折叠的 条评论
为什么被折叠?



