HOME
Stephen Knight
02/18/2010 11:05 PM
Configure Archive Profile

Type:

LotusScript

Category:

Archive
Hide details for CodeCode
Sub Click(Source As Button)
'Changed
'
Dim db As notesdatabase
Dim doc As notesdocument
Dim session As New notessession
Dim filename As String

Dim result As Integer

Set db = session.currentdatabase
Set doc=db.getprofiledocument("Archive Profile")

result=Messagebox("Do you want to configure archive for " & db.Title & " ?",3,"Notes Archiving")
If result<>6 Then Exit Sub

filename=Left$(Left$(db.filename,Len(db.filename)-4),6)+".nsf"


doc.ArchiveLog="Yes"
doc.ArchiveLogDBPath="archive\l_"&filename

doc.ArchiveInactive=""
'doc.DocumentLife=365

doc.ArchiveModified=""
'doc.ModifiedLife=365

doc.ArchiveExpired=""
'doc.ExpiredLife=5

doc.ArchiveLocation="Server"
doc.ArchivePath="archive\a_"&filename
doc.ArchiveServer=db.Server
doc.ArchivingServer=db.Server
doc.Enabled="Yes"
doc.ServerEnabled="Yes"

Call doc.computewithform(True,True)
Call doc.sign()
Call doc.save(True, True)

Messagebox |Thankyou. Your archive settings have now been set to archive mail to | & doc.ArchivePath(0) & | on the | & doc.ArchiveServer(0) & |server.
* All automatic archiving has been turned off for now. You can select mails and drag them to the archive folder or use Actions \ Archive \ Selected Documents.
* To switch on automated archiving please go to Actions \ Archive Settings and choose the age of emails you want to have archived.| ,MB_OK,"Notes Archiving"

End Sub

or

Sub Click(Source As Button)
       
        Dim db As notesdatabase
        Dim doc As notesdocument
        Dim session As New notessession
        Dim filename As String
       
        Dim result As Integer
       
        Set db = session.currentdatabase
        Set doc=db.getprofiledocument("Archive Profile")
       
        result=Messagebox("Do you want to configure archive for " &  db.Title & " ?",3,"Notes Archiving")
        If result<>6 Then Exit Sub
       
        filename=Left$(Left$(db.filename,Len(db.filename)-4),6)+".nsf"
       
       
        doc.ArchiveLog="Yes"
        doc.ArchiveLogDBPath="archive\l_"&filename
       
        doc.ArchiveInactive=""
        'doc.DocumentLife=365
       
        doc.ArchiveModified=""
        'doc.ModifiedLife=365
       
        doc.ArchiveExpired=""
        'doc.ExpiredLife=5
       
        doc.ArchiveLocation="Server"        
        doc.ArchivePath="archive\a_"&filename
        doc.ArchiveServer=db.Server
        doc.ArchivingServer=db.Server
        doc.Enabled="Yes"
        doc.ServerEnabled="Yes"
       
        Call doc.computewithform(True,True)
        Call doc.sign()
        Call doc.save(True, True)
       
        Messagebox |Thankyou.  Your archive settings have now been set to archive mail to | & doc.ArchivePath(0) & | on the | & doc.ArchiveServer(0) & |server.
* All automatic archiving has been turned off for now.  You can select mails and drag them to the archive folder or use Actions \ Archive \ Selected Documents.
* To switch on automated archiving please go to Actions \ Archive Settings and choose the age of emails you want to have archived.| ,MB_OK,"Notes Archiving"
       
End Sub


Hide details for ExplanationExplanation
Show details for ExamplesExamples
Hide details for AttachmentsAttachments