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)
	Loop
	
	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 first published in July 2001

Dig deeper on Lotus Notes Domino Administration Tools

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close