changing outlook mail status

jalldridge

Registered User.
Local time
Today, 05:47
Joined
May 3, 2005
Messages
60
Hi guys

I'm writing an app that does a recursive search from a top level folder looking for unread emails. I then pull out the info from the msg.Body and put this into access.

However I've yet to find a way of alterting the state of the msg from unread to read.

Any ideas what to do??

Heres some code to show what I'm doing so far:

Code:
  Dim numfolders As Integer
    numfolders = mDownloadFolder.Folders.Count

    
    Dim currentFolderNum As Integer
    
    For currentFolderNum = 1 To numfolders
    
        Set mCurrentFolder = mDownloadFolder.Folders.Item(currentFolderNum)
        
        Dim numMails  As Integer
        numMails = mCurrentFolder.Items.Count
        
        'For Each msg In mCurrentFolder.Items
        'count backward through mails as most recent is last in...

        Dim j As Integer
        For j = numMails To 1 Step -1
            Set msg = mCurrentFolder.Items(j)
            If msg.UnRead Then
                
                getMailDetails (j)
                
            Else
                'if we have read an item then its already been dealt with
                'go to next folder
                MsgBox "no unread mail in " & mCurrentFolder
                Exit For
            End If
            
        Next j
    
    Next currentFolderNum

Thanks :-)
 
Can't you just set it in this block...?
Code:
If msg.UnRead Then
  getMailDetails (j)
[COLOR=DarkRed]  msg.UnRead = false[/COLOR]
Else
  ...
End If
 
err yes that could possibly do the trick. I dont know why I didnt think of that. Too obvious :D

Thanks for the come back
 

Users who are viewing this thread

Back
Top Bottom