Click here to Skip to main content
13,295,178 members (70,028 online)
Click here to Skip to main content
Add your own
alternative version


40 bookmarked
Posted 4 Jan 2004

How to Create Birthday Reminders Using Microsoft Outlook, in C#

, 4 Jan 2004
Rate this:
Please Sign up or sign in to vote.
This article shows you hot to use Microsoft Outlook appointments. I used a version of the code to put reminders in for my family members.


I guess it isn't rocket science to put birthday reminders into Outlook, but nevertheless, doing it in C# code cost me more effort than it should have. So without further ado, here is the code.


  1. Ensure you reference Microsoft Outlook, then create a new application.
    Outlook._Application olApp = 
       (Outlook._Application) new Outlook.Application();
  2. Log on. (I think email needs to be running)
    Outlook.NameSpace mapiNS = olApp.GetNamespace("MAPI")
    string profile = "";
    mapiNS.Logon(profile, null, null, null);
  3. Repeat the line.
    CreateYearlyAppointment(olApp, "Birthday", 
       "Kim", new DateTime(2004, 03,08, 7, 0, 0));

    for your wife and kids etc. etc.!!!

The Code

static void CreateYearlyAppointment(Outlook._Application olApp, 
    string reminderComment, string person, DateTime dt)
   // Use the Outlook application object to create an appointment
   Outlook._AppointmentItem apt = (Outlook._AppointmentItem)
   // set some properties
   apt.Subject = person + " : " + reminderComment;
   apt.Body = reminderComment;
   apt.Start = dt;
   apt.End   = dt.AddHours(1);
   apt.ReminderMinutesBeforeStart = 24*60*7 * 1;  // One week reminder
   // Makes it appear bold in the calendar - which I like!
   apt.BusyStatus = Outlook.OlBusyStatus.olTentative; 
   apt.AllDayEvent = false;
   apt.Location = "";
   Outlook.RecurrencePattern myPattern = apt.GetRecurrencePattern();
   myPattern.RecurrenceType = Outlook.OlRecurrenceType.olRecursYearly;
   myPattern.Interval = 1;

Reap The Rewards

With a one week reminder, you will never again forget your Mum's birthday.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Frank Eden
Web Developer
Australia Australia
Frank has been in computing since the age of the dinosaurs. He prefers playing table tennis to writing C#, C++, VB, or any of the other dozen or more languages he has written since the Jurasic.

You may also be interested in...


Comments and Discussions

GeneralError when creating birthday reminder in ASP.NET Pin
Simomo23-Mar-09 4:30
memberSimomo23-Mar-09 4:30 
GeneralRe: Error when creating birthday reminder in ASP.NET Pin
Tauiqr17-Oct-12 23:03
memberTauiqr17-Oct-12 23:03 
QuestionAdding the reminder in a Calendar in Public Folder?? Pin
Rahul Vac27-Mar-07 0:27
memberRahul Vac27-Mar-07 0:27 
QuestionRegarding to creating Birthday Reminder Pin
Thimani12-Feb-07 19:27
memberThimani12-Feb-07 19:27 
GeneralSolution if you get error 80004005 Pin
KirbzStar28-Nov-06 15:56
memberKirbzStar28-Nov-06 15:56 
GeneralLogon without Outlook Running Pin
mtbbiker3-Oct-05 2:35
membermtbbiker3-Oct-05 2:35 
Questionversion independent ? Pin
fracalifa1-Apr-05 0:50
memberfracalifa1-Apr-05 0:50 
Hello csharper's,

I have two questions.

does the program also run when I'm referencing to Office 9-DLL'S (XP) and the customer uses older versions of Outlook (2000)


Is there a simple solution to check if Outlook is already installed (whithout using exception handling)

Thank You

PS.: The code is no rocket science .... but usefull.

GeneralError Outlook unrecoqnized Pin
chikku8-Mar-04 23:28
susschikku8-Mar-04 23:28 
GeneralRe: Error Outlook unrecoqnized Pin
partyganger9-Mar-04 0:56
memberpartyganger9-Mar-04 0:56 
GeneralRe: Error Outlook unrecoqnized Pin
NITH30-Apr-04 4:35
memberNITH30-Apr-04 4:35 
GeneralError Outlook unrecoqnized Pin
chikku8-Mar-04 23:27
memberchikku8-Mar-04 23:27 
QuestionAnyone ported this to C#? Pin
dragomir3-Feb-04 1:02
memberdragomir3-Feb-04 1:02 
AnswerRe: Anyone ported this to C#? Pin
NITH30-Apr-04 4:27
memberNITH30-Apr-04 4:27 
QuestionCreate a message rule? Pin
dragomir22-Jan-04 23:33
memberdragomir22-Jan-04 23:33 
AnswerRe: Create a message rule? Pin
Frank Eden26-Jan-04 12:50
memberFrank Eden26-Jan-04 12:50 
GeneralSending Outlook items Pin
Anonymous13-Jan-04 2:30
sussAnonymous13-Jan-04 2:30 
GeneralRe: Sending Outlook items Pin
Frank Eden13-Jan-04 11:59
memberFrank Eden13-Jan-04 11:59 
GeneralExcellent article Pin
Per Søderlind5-Jan-04 22:30
sussPer Søderlind5-Jan-04 22:30 
GeneralRe: Excellent article Pin
NITH30-Apr-04 4:29
memberNITH30-Apr-04 4:29 
GeneralWhats the purpose Pin
super5-Jan-04 19:29
membersuper5-Jan-04 19:29 
GeneralRe: Whats the purpose Pin
Frank Eden5-Jan-04 19:54
memberFrank Eden5-Jan-04 19:54 
GeneralRe: Whats the purpose Pin
gUnOm20-Feb-05 23:49
membergUnOm20-Feb-05 23:49 
GeneralRe: Whats the purpose Pin
Malik Nasir14-May-06 23:55
memberMalik Nasir14-May-06 23:55 
GeneralRe: Whats the purpose Pin
laribum4-Sep-06 3:44
memberlaribum4-Sep-06 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171207.1 | Last Updated 5 Jan 2004
Article Copyright 2004 by Frank Eden
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid