Busy Property
 Indicates whether IMAP4 
  object is performing long-run operation (such as connecting to the server or 
  retrieving messages).
  
  When IMAP4 object is busy, attempt to call any of its methods which exchange 
  data with IMAP4 server will immediately exit. To cancel currently executing 
  long-run operation, call Abort 
  method.
  
  Note: Busy property is useful on conditions that IMAP4 
  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 objIMAP4 As Object
Private Sub Command1_Click()
  Dim Envelopes As Object
  Set objIMAP4 = CreateObject("MailBee.IMAP4")
  objIMAP4.LicenseKey = "put your license key here"
  objIMAP4.EnableEvents = True ' Enable asynchronous mode
  If objIMAP4.Connect("mailserver.com", 143, "MyName", "MyPassword") Then ' Long-run operation
    If objIMAP4.SelectMailbox("Inbox") Then ' Long-run operation
       Set Envelopes = objIMAP4.RetrieveEnvelopes(1, objIMAP4.MessageCount, False) ' Long-run operation
    End If
    objIMAP4.Disconnect ' Long-run operation
  End If
End Sub
Private Sub Form_Load()
    Set objIMAP4 = Nothing
End Sub
Private Sub Form_Unload(Cancel As Integer)
    If objIMAP4 Is Nothing Then Exit Sub
    If objIMAP4.Busy Then objIMAP4.Abort ' Cancel IMAP4 session on exit
End Sub
See Also:
EnableEvents 
  Property
  Abort Method 
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.