Cleaning You Inbox
Home Up Cleaning You Inbox Error NotesUIDocument Inuse IsMailStationery FTSearch

 

Home Next

Up

ourmission
theweb.gif (1103 bytes)
booksandbibles16
thenewsroom
governmentrm.gif (1147 bytes)
searchpage
tutorials
webtools
websecurity

What is the Web?

Privacy & Disclaimer
copyrights
notices
HOME

Visitors Since
Aug - 2004

Hit Counter

 

RNext: Cleaning the Inbox

Sometimes, the easiest way to learn things is to apply them to your daily activities. With Notes, it is your eMail inbox. Or at least for me it is.

I like to know that my messages get through. Especially when it is going to an outside client. Therefore I like to use two great little tools. And they are Confirm Delivery and Return Receipt.

They are great, in my opinion because you never know when the internet is in a bad mood these days. Those moods could delay your message to its destination, or just drop it. These two actions help to relieve some of the tension.

However, you know need to clean up your inbox! So, lets make our first project a simple little agent called Clean, the inbox cleaner. If you have a document open at the time you run the agent, then you will want to see Error NotesUIDocument Inuse.

Since your the manager of your mailbox, goto your Notes 6 menu bar, and Create – Agent.

  This will launch the Lotus Domino Designer tool, if you have it installed. In the code window on the right hand side, you want to change the option to LotusScript, in the dropdown box on the far right.

At first, you would think that you could simply make a document collection, and search for the Subject having Delivery in it. However, this is a function of the view, and the actual message is using a form called “Delivery Notification.” So, what I did next, was to make a collection based on “Form=Delivery Notification” and then checked the dates for all of the forms.

  In the objects, you will select the Initialize event, just for simplicity’s sake, and add the following code into that subroutine.

Text Box: Sub Initialize
	Dim session As New NotesSession
	Dim db As NotesDatabase
	Dim doc As NotesDocument
	Dim collection As NotesDocumentCollection
	Dim mSubject 
	Dim i As Integer 
	Dim cMoved  As Integer 
	
	Dim mSubjectStr As String
	Dim myDate 
	Dim searchFormula As String
	
	Set db = session.CurrentDatabase
	
	cMoved = 0
	myDate =Today
	mydate = Today  - 30
	searchFormula="Form=""Delivery Report"""
	Set collection =  db.Search(searchFormula, Nothing, 0)
	Print "Checkinng " ,  collection.Count, " documents..."
	If collection.Count <> 0 Then
		For i=1 To collection.Count
			Set doc=collection.GetNthDocument(i)
			Print "Checking  .." , i, " Moved: ", cMoved
			mSubject = doc.Created 	
			If doc.created < Datevalue(myDate) Then
				Print "Trashing: """ + mSubjectStr  + """ ...", i
				cMoved = cMoved + 1
				doc.PutInFolder( "Trash" )
		'		doc.RemoveFromFolder( "($Inbox)" )
			End If
		Next
		Print "Checking Done .." , i, " Moved: ", cMoved
	End If
	
End Sub

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Always remember to SAVE your code before stating the debugger. Until you save it, it is only in the designer, and not in your Lotus Notes mail database on the server.

Your code window should look something like this, now.

 

You then go into the properties window and select Agent. In this pane you will name the agent Cean Inbox, make it an Action Menu Selection, and set the target to All documents in the view.

 

Debugging Your Lotus Domino LotusScript Agent

Now we need to enable the debugger in your Lotus Notes Client. Goto the menu bar in the Lotus client window, and select File – Tools – Debug LotusScript.

This is a toggle item, and it will be checked, when it is enabled. So a little popup window will indicate its state, as follows:

Click OK, and the item is now checked, and your LotusScript debugger is ready to step you through your new agent.

Always remember to SAVE your code before stating the debugger. Until you save it, it is only in the designer, and not in your Lotus Notes mail database on the server.

 

 

Select your newly created agent from the Actions menu.

This will now launch the LotusScript debugger to run your newly created code.

We will be using two buttons, for now. They are Step Into, and Stop.

This allows us to look at our code line by line (Step Into), and end it completely (Stop). Since we will be editing our code in the designer agent window, just stopping is good for now. Our complete window should look like this,

Now you can update your code, to work on the “Returned Receipts” or any other messages that you would like to periodically clean out of your inbox.

And, I suggest moving them to the Trash Folder. Because this will give you a chance to change your mind.

Hit Counter since 12 Oct 2002