एक आवर्ती कार्य बनाएँ

VSTO

नीचे तारीख के आधार पर कार्य की पुनरावृत्ति दिखाने वाला कोड स्निपेट दिया गया है:


     Outlook.TaskItem task = Application.CreateItem(

    Outlook.OlItemType.olTaskItem) as Outlook.TaskItem;

    task.Subject = "Tax Preparation";

    task.StartDate = DateTime.Parse("4/1/2007 8:00 AM");

    task.DueDate = DateTime.Parse("4/15/2007 8:00 AM");

    Outlook.RecurrencePattern pattern = task.GetRecurrencePattern();

    pattern.RecurrenceType = Outlook.OlRecurrenceType.olRecursYearly;

    pattern.PatternStartDate = DateTime.Parse("4/1/2007");

    pattern.NoEndDate = true;

    task.ReminderSet = true;

    task.ReminderTime = DateTime.Parse("4/1/2007 8:00 AM");

    task.Save();

Aspose.Email

Aspose.Email एक पुनरावर्ती कार्य बनाने की अनुमति देता है जहाँ पुनरावृत्ति दैनिक, साप्ताहिक, मासिक या वार्षिक हो सकती है। नीचे दिया गया कोड नमूना साप्ताहिक पुनरावृत्ति वाले कार्य को बनाना दर्शाता है।


   DateTime startDate = new DateTime(2015, 04, 30, 10, 00, 00);

  MapiTask task = new MapiTask("abc", "def", startDate, startDate.AddHours(1));

  task.State = MapiTaskState.NotAssigned;

  // Set the weekly recurrence

  var rec = new MapiCalendarDailyRecurrencePattern

  {

     PatternType = MapiCalendarRecurrencePatternType.Day,

     Period = 1,

     WeekStartDay = DayOfWeek.Sunday,

     EndType = MapiCalendarRecurrenceEndType.NeverEnd,

     OccurrenceCount = 0,

  };

  task.Recurrence = rec;

  task.Save("AsposeDaily.msg", TaskSaveFormat.Msg);

नमूना कोड डाउनलोड करें

चल रहा कोड डाउनलोड करें