Manage Learn to apply best practices and optimize your operations.

Mail "todo" list

I wrote this agent to read the default Todo View, and send the user the email with a list of the documents.

Because the Description field on the ToDo form is Rich Text, it cannot be displayed in a view. One of our salesmen wanted to be able to print the view to show his supervisor his plans for the week. I wrote this agent to read the default Todo View, and send the user the email with a list of the documents including the description field. I placed the agent in the Actions menu so anyone could run it from our Contacts DB.
Sub Initialize
	'Get session to get user
	Dim session As New NotesSession
	Dim user As String
	user = session.CommonUserName
	'Get the user's information
	Dim reg As New NotesRegistration
	reg.RegistrationServer = "Server00"  'Your server name
	Call reg.GetUserInfo( user, retmailserver$,retmailfile$, retmaildomain$, retmailsystem%, retprofile$)
	'Continue with user information
	Dim db As New notesdatabase(retmailserver$, retmailfile$)
	Dim col As notesview
	Set col = db.getview("($ToDo)")
	Dim doc As notesdocument
	Set doc = col.getfirstdocument()
	Dim mailsubject As String
	Dim mailBody As Variant
	Dim count As Integer
	Dim mybody As String
	Set doc = col.getfirstdocument()
	Do While Not (doc Is Nothing)
		mailsubject = doc.subject(0)
		Set mailbody = doc.GetFirstItem( "Body" )
		If ( mailbody.Type = RICHTEXT ) Then
			plainText = mailbody.GetFormattedText( False, 0 )
		End If
		Set item = doc.GetFirstItem( "calendardatetime" )
		Set mailentry = item.DateTimeValue
		Count = Count +1
		mybody = mybody  & Cstr(Count) & "." &  "Entered: " &Mailentry.dateonly & " - " & mailsubject &":  " & plaintext  & Chr(10) & Chr(13)
		Set doc = col.getnextdocument(doc)
	Set doc = New notesdocument(db)
	doc.sendto = user
	'doc.copyto = "Bosses Name"  'You can use this line or disregard.
	Dim datestring As String
	datestring = Cstr(Today)
	doc.subject = "Todo list as of: " & datestring
	doc.form = "Memo"
	doc.body = mybody
	Call doc.send(False)
End Sub
This was last published in July 2001

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...