Expert Answer Center > Experts On Demand > View Answer
EMAIL THIS
Experts on Demand
  EXPERTS ON DEMAND HOME     POSE A QUESTION     VIEW ANSWERS     BROWSE BY TOPIC        RSS FEEDS  
As a K-12 school district with 800 staff members, each with Lotus Notes e-mail accounts, getting users to clean up their basic folders (the inbox and sent folders) is difficult. During this summer, we want to automatically purge both folders for each user based upon a given date. What would be the best way to accomplish a purge using a selected date for both folders -- using the "Remove" option on the Sent folder items? QUESTION POSED ON: 13 JUN 2005
QUESTION ANSWERED BY: Mathew Newman I know of a few organizations who have implemented this type of document "purge" in order to have documents located in either the sent folder or inbox to be automatically deleted after a given period of time.

I understand the logic behind it -- a document, for example, in the Inbox after a month is "stale." So those organizations make users who want to keep e-mail move if from the inbox/sent folders within a certain timeframe and place it in another "personal" folder, otherwise the document is deleted.

Not that I agree with the logic -- I just understand it.

The easiest way to accomplish your task is to create a scheduled agent, which would cycle through all the documents located in the folders you have specified, and delete any documents that were created before your selected date.

Be aware the "Remove" method of LotusScript will delete the document (or place it in the trash if "soft deletions" are turned on). If you use the "RemoveFromFolder" method, the document will be removed from the folder, but will still be available in the "All Documents" and "Mail Threads" views.

Your agent would look something like this...

        Dim db As New NotesDatabase( "yourserver", "mail\themail.nsf" ) 
        Dim view As NotesView 
        Dim doc As NotesDocument 
        Dim docr As NotesDocument 'Temporary placeholder to delete document 
        Set view = db.GetView( "($Inbox)" ) 
        Set doc = view.GetFirstDocument 
        
        While Not(doc Is Nothing) 
                Set docr = doc 
                Set doc = view.GetNextDocument(doc) 
                If docr.Created < Datenumber( 2005, 7, 4 ) Then 
                        Call docr.Remove 
                End If 
        Wend 
Substitute Call docr.Remove, with Call doc.RemoveFromFolder( "($Inbox)") if your intention is just to "clean up" the inbox/sent folders, rather than deleting those e-mail messages.
HomeExperts on DemandIT Expert Webcast SeriesExpert KnowledgebaseSite Index
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts