Sample code for 30+ languages & platforms
Visual Basic 6.0

Transition from Imap.ListMailboxes to Imap.MbxList

Provides instructions for replacing deprecated ListMailboxes method calls with MbxList.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim imap As New ChilkatImap

' ...
' ...

Dim reference As String
reference = ""
Dim mbxPattern As String
mbxPattern = "*"

' ------------------------------------------------------------------------
' The ListMailboxes method is deprecated:

' Lists all mailboxes, including unsubscribed.
Dim mboxesObj As Mailboxes
Set mboxesObj = imap.ListMailboxes(reference,mbxPattern)
If (imap.LastMethodSuccess = 0) Then
    Debug.Print imap.LastErrorText
    Exit Sub
End If

' ...
' ...

' ------------------------------------------------------------------------
' Do the equivalent using MbxList.
' Your application creates a new, empty Mailboxes object which is passed 
' in the last argument and filled upon success.

' Lists all mailboxes, including unsubscribed.
Dim subscribed As Long
subscribed = 0

Dim mboxes As New Mailboxes
success = imap.MbxList(subscribed,reference,mbxPattern,mboxes)
If (success = 0) Then
    Debug.Print imap.LastErrorText
    Exit Sub
End If