7,785
社区成员




Sub vbld_StepStarted()
Dim nI
Dim objSteps
Dim objStep
Dim objDom
Dim objNode
Dim objNodes
Dim objAttribute
Dim sVersion
Dim sStepName
Dim bStepEnabled
Set objSteps = Application.Project.Steps(vbldStepMain)
For Each objStep In objSteps
If objStep.BuildStatus = vbldStepStatInProgress Then
sVersion = objStep.Property("Version")
Call Application.Macros(vbldMacroTemporary).Add("STEP_VERSION", sVersion)
Exit For
End If
Next
End Sub
Sub vbld_StepStarted()'声明一个叫vbld_StepStarted的子程序
Dim nI'声明变量
Dim objSteps
Dim objStep
Dim objDom
Dim objNode
Dim objNodes
Dim objAttribute
Dim sVersion
Dim sStepName
Dim bStepEnabled
Set objSteps = Application.Project.Steps(vbldStepMain)'声明一个对象集合(这里本身有错,没有指明Application对象,不过可能有其他的子程序声明了这个对象)
For Each objStep In objSteps'对对象集合里的每一个元素进行操作
If objStep.BuildStatus = vbldStepStatInProgress Then'如果BuildStatus属性是vbldStepStatInProgress的话
sVersion = objStep.Property("Version")'调用Property函数,并将返回值赋给变量sVersion
Call Application.Macros(vbldMacroTemporary).Add("STEP_VERSION", sVersion)'调用Application对象的Macros方法
Exit For跳出循环
End If
Next
End Sub