PC Review


Reply
Thread Tools Rate Thread

Mark mail read via ADO as read

 
 
Blaine Fredrickson
Guest
Posts: n/a
 
      25th Oct 2003
I've managed to create code that will get all the e-mail
from my inbox using ado.

I can update some fields, and even delete the mail using
normal ado methods, but I can't find a way to mark the
mail as "read", or to change a "read" message back
to "unread".

Any ideas???

Here's the code:

Dim iMaxMsg As Integer, i As Integer
Dim sMsg As String
Dim adoconn As ADODB.Connection
Set adoconn = New ADODB.Connection
adoconn.ConnectionString
= "Provider=Microsoft.JET.OLEDB.4.0;Exchange
4.0;MAPILEVEL=Mailbox - WIP|;DATABASE=c:\temp;"

adoconn.Open

Dim adors As ADODB.Recordset
Set adors = New ADODB.Recordset

adors.Open "select [Inbox].* from [Inbox];", adoconn,
adOpenDynamic, adLockOptimistic

Do While Not adors.EOF
On Error Resume Next
sMsg = ""
For i = 0 To 20
sMsg = sMsg & i & adors.Fields(i).Name & " - " &
adors.Fields(i).Value & vbCrLf
Next i
MsgBox (sMsg)
'adors.Delete ' this will delete it
'adors.Fields(0).Value = 0 ' this will change the
priority
'adors.Update
adors.MoveNext
DoEvents
Loop
adors.Close
Set adors = Nothing

adoconn.Close
Set adoconn = Nothing



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Mark Junk e-Mail As Read - mark as read =?Utf-8?B?cHJk?= Microsoft Outlook Discussion 2 29th Oct 2007 11:49 PM
Why isn't quotation Mark between quotation Mark(String defining) possible? kimiraikkonen Microsoft VB .NET 1 10th Oct 2007 08:09 PM
McAfee SpamKiller icons "Mark as SPAM" / "Mark as not SPAM" - Wher =?Utf-8?B?bW93bW93?= Microsoft Outlook Discussion 1 22nd Jul 2007 07:12 AM
Mark Index Entry>Mark All =?Utf-8?B?TWFyayBJbmRleCBFbnRyeT5NYXJrIEFsbA==?= M Microsoft Word Document Management 2 29th Mar 2006 12:09 AM
Can I mark Appointments as completed (check mark, line through, et =?Utf-8?B?ZHJzaHJpbmt3cmFw?= Microsoft Outlook Calendar 1 6th Nov 2004 10:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:45 PM.