Busy Property


Indicates whether POP3 object is performing long-run operation (such as connecting to the server or retrieving messages).

When POP3 object is busy, attempt to call any of its methods which exchange data with POP3 server will immediately exit. To cancel currently executing long-run operation, call Abort method.

Note: Busy property is useful on conditions that POP3 object operates in Async mode. See EnableEvents property description for details.


Value Type: Boolean
Parameters: None 
Remarks: This property is read-only

Usage example:

Option Explicit
Dim objPOP3 As Object

Private Sub Command1_Click()
  Dim Msgs As Object
  Set objPOP3 = CreateObject("MailBee.POP3")
  objPOP3.LicenseKey = "put your license key here"
  objPOP3.EnableEvents = True ' Enable asynchronous mode
  If objPOP3.Connect("mailserver.com", 110, "MyName", "MyPassword") Then ' Long-run operation
    Set Msgs = objPOP3.RetrieveHeaders ' Long-run operation
    objPOP3.Disconnect ' Long-run operation
  End If
End Sub

Private Sub Form_Load()
    Set objPOP3 = Nothing
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If objPOP3 Is Nothing Then Exit Sub
    If objPOP3.Busy Then objPOP3.Abort ' Cancel POP3 session on exit
End Sub

See Also:

EnableEvents Property
Abort Method


Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.