This example displays the number of steps in the current task in a message box.
Sub Main
MsgBox CurrentTask2.StepCount
End Sub