Setting Reminder\Alarms from any application

Have you ever wanted to have your application set a reminder\alarm in the user's mailfile (with pop-up and all)?

Have you ever wanted to have your application set a reminder\alarm in the user's mailfile (with pop-up and all)?

Well, here's a little function that'll do it for you. Just parse in the dateTime, the Pop-Up Text and Subject Text (for the calendar view), and all is done.

Sub createReminder( dateTime As notesDateTime, popUpStr As String, subjectStr As String )
	
	'// DECLARATIONS
	Dim sess As New NotesSession
	Dim userMailDb As New NotesDatabase( "", "" )
	Dim reminderDoc As NotesDocument
	Dim DTItem As NotesItem
	
	'// OPEN MAILFILE
	Call userMailDb.OpenMail
	
	'// CREATE DOCUMENT
	
	If userMailDb.IsOpen Then
		Print "Creating reminder..."
		Set reminderDoc = New NotesDocument( userMailDb )		
		
		With reminderDoc
			
			.Form = "Appointment"
			.ReplaceItemValue 	"$Alarm", 					1
			.ReplaceItemValue 	"$AlarmDescription", 		popUpStr
			.ReplaceItemValue 	"$AlarmMemoOptions", 	""
			.ReplaceItemValue 	"$AlarmOffset", 			0
			.ReplaceItemValue 	"$AlarmUnit", 				"M"
			
			.Subject 			= subjectStr
			.Alarms			= "1"
			
			.CalendarDateTime = dateTime.lsLocalTime
			.StartDate 		= dateTime.lsLocaltime
			.StartTime		= dateTime.lsLocaltime
			.StartDateTime	= dateTime.lsLocaltime
			
			.EndDate 		= dateTime.lsLocaltime
			.EndTime		= dateTime.lsLocaltime
			.EndDateTime	= dateTime.lsLocaltime
			
			.AppointmentType = 4
			
			.ComputeWithForm False, False
			.Save True, False
			
			.PutInFolder( "$Alarms" )
			
		End With
		Print "Creating reminder...Successful"			

	Else
		Print "Creating Reminder...Error - Cannot open user's MailFile."		
	End If
	
End Sub
This was last published in April 2002

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.

-ADS BY GOOGLE

SearchWindowsServer

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

SearchDataCenter

SearchExchange

SearchContentManagement

Close