I wrote a function to delete specific messages in an archive sync. It works
just find as long as the url (file name) does not include any illegal
characters. Is there a way to use cdoex to delete the messages as an
alternative or someway to replace the illegal characters? Below is the
function which takes a single parameter. Such as
(file://./storeage/domain/MBX/archive/Inbox/goodStuff.EML) and it delete the
email.
If the file name is such as (file://./storeage/domain/MBX/archive/Inbox/bad
stuff == % $ #@.EML) and fails to delete the email.
Private Sub DeleteMailRecord(ByVal sURL As String)
Dim Rec As New ADODB.Record
Dim Conn As New ADODB.Connection
Try
Conn.Provider = "ExOLEDB.DataSource"
Conn.Open(sURL)
Rec.Open(sURL, Conn, ADODB.ConnectModeEnum.adModeReadWrite)
Rec.DeleteRecord()
Catch ex As Exception
MessageStore += "ERROR-Delete: " & ex.Message & sURL
Finally
Conn.Close()
End Try
End Sub
--
Philip