Monday, August 22, 2011

Return a Domino ArchiveDB to a Mail File

What is the difference between a Domino Archive database and a normal mail file?  Nothing but a profile document.  So, how do you return that status of an archive database to a standard mail file?  Use this script:

     Sub Initialize
       Dim session As New NotesSession
       Dim db As NotesDatabase
       Dim doc As NotesDocument
       Dim item As notesitem

       Set db = session.CurrentDatabase
       Set doc = db.GetProfileDocument("Archive Database Profile")

       If doc Is Nothing Then
          Print "No profile found"
       Else
         Print "Profile found"
         Set item=doc.GetFirstItem("ArchiveDatabase")
       If Not item Is Nothing Then
         Call item.remove
       End If
       End If

       Call doc.Remove( True)
       End Sub


Add this agent to your archive database, run it and your file will be changed back to a normal database after being an archive -- WOW!  Magic!

No comments: