Attribute VB_Name = "Module1"
Sub main()
    Call CREATE
    Call COPY
    Call DELETE
End Sub
Public Sub CREATE()
    Dim oRec As New ADODB.Record
    Dim oCon As New ADODB.Connection
    Dim srcURL As String
    
    srcURL = "file://./BackOfficeStorage/ywd.extest.microsoft.com/MBX/user1/inbox/NewMsg.eml"
    
    With oCon
        .Provider = "ExOledb.datasource"
        .ConnectionString = srcURL
        .Open
    End With

    oRec.Open Source:=srcURL, ActiveConnection:=oCon, Mode:=adModeReadWrite, createoptions:=adCreateNonCollection Or adOpenIfExists
    
    Set oRec = Nothing
    Set oCon = Nothing
End Sub
Public Sub COPY()
    Dim oRec As New ADODB.Record
    Dim oCon As New ADODB.Connection
    Dim strURL As String
    Dim strSRC As String
    Dim strDEST As String
        
    strURL = "file://./backofficestorage/ywd.extest.microsoft.com/MBX/user1"
    strSRC = strURL & "/Inbox/NewMsg.eml"
    strDEST = strURL & "/Drafts/AnotherMsg.eml"
        
    With oCon
        .ConnectionString = strURL
        .Provider = "Exoledb.datasource"
        .Open
    End With
        
    With oRec
        .ActiveConnection = oCon
        .Source = strSRC
    End With
             
    oRec.Open Mode:=adModeReadWrite, createoptions:=adOpenIfExists
    oRec.CopyRecord Source:=strSRC, Destination:=strDEST, Options:=adCopyOverWrite
    
    Set oRec = Nothing
    Set oCon = Nothing
End Sub

Public Sub DELETE()
   Dim oRec As New ADODB.Record
   Dim oCon As New ADODB.Connection
   Dim strURL As String
   
   strURL = "file://./backofficestorage/ywd.extest.microsoft.com/MBX/user1/Drafts/AnotherMsg.eml"
   
   With oCon
        .ConnectionString = strURL
        .Provider = "Exoledb.datasource"
        .Open
   End With
    
   oRec.Open strURL, oCon, adModeReadWrite
   oRec.DeleteRecord
   
   Set oRec = Nothing
   Set oCon = Nothing
End Sub

