Msg.Thermometer (property)

Syntax Msg.Thermometer [= percentage]
Description Changes the percentage filled indicated within the thermometer of a message dialog box (one that was previously opened with the Msg.Open method).
Comments A runtime error will result if a message box is not currently open (using Msg.Open ) or if the value of percentage is not between 0 and 100 inclusive.
Example This example create a modeless message box with a thermometer and a Cancel button. This example also shows how to process the clicking of the Cancel button.
Sub Main()
  On Error Goto ErrorTrap
  Msg.Open "Reading records from file...",0,True,True
  For i = 1 To 100  'Read a record here.
    'Update the modeless message box.
    Msg.Thermometer =i
    DoEvents
    Sleep 50
  Next i
  Msg.Close
  On Error Goto 0   'Turn error trap off.
  Exit Sub
ErrorTrap:
  If Err = 809 Then
    MsgBox "Cancel was pressed!"
    Exit Sub    'Reset error handler.
  End If
End Sub
See Also Msg.Close (method); Msg.Open (method); Msg.Text (property).