Sample code for 30+ languages & platforms
Visual Basic 6.0

Transition from Imap.FetchSequence to Imap.FetchRange

Provides instructions for replacing deprecated FetchSequence method calls with FetchRange.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim imap As New ChilkatImap

' ...
' ...

Dim startSeqNum As Long
startSeqNum = 1
Dim count As Long
count = 5

' ------------------------------------------------------------------------
' The FetchSequence method is deprecated:

Dim bundleObj As ChilkatEmailBundle
Set bundleObj = imap.FetchSequence(startSeqNum,count)
If (imap.LastMethodSuccess = 0) Then
    Debug.Print imap.LastErrorText
    Exit Sub
End If

' ...
' ...

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

Dim headersOnly As Long
headersOnly = 0

Dim bundleOut As New ChilkatEmailBundle
success = imap.FetchRange(headersOnly,startSeqNum,count,bundleOut)
If (success = 0) Then
    Debug.Print imap.LastErrorText
    Exit Sub
End If