I require to loop through the data\mail directory only and retrieve first dB,get all the documents from that dB and copy across to a new directory
(data\mail\archive). Then loop through remaining Db’s and do the same…
Can someone help with the code, please. Cut down version…
Set directory = session.GetDbDirectory(“App01”)
Set db = directory.GetFirstDatabase(DATABASE)
’ Want oto identfy the mail directory here and loop
While Instr(db.filepath,“mail”) <> 1
Set archiveDb = db.CreateCopy(archiveServer, archiveFile)
Set collection = Source.AllDocuments
Set doc = collection.GetFirstDocument()
' Okay we need to Archive docs prior to a specified a date
While Not(doc Is Nothing)
If ( doc.Created < Datenumber( 2003, 01, 01 ) ) Then
'Copy all Documents to TARGET
Call doc.CopyToDatabase( archiveDb )
End If
Set doc = collection.GetNextDocument(doc)
Wend
set db = directory.GetNextDatabase
Wend