Outlook add-in (auto-scheduler)

Hi, I'm writing an add-in for Outlook 2003 which takes the tasks from the task list and schedules them in to the calendar with respect to task priority. I have managed to sort the tasks by priority in the task list view via:

_Items olTasks = olFolderTask.Items; // MSO items collection in folder

olTasks.Sort("[Priority]", true); // sort items by Priority before reading

int nTasksCount = olTasks.Count;

for (int i = 0; i < nTasksCount; ++i)

{

_TaskItem olItemTask;

try

{

if (i == 0) // Should be called first before iteration start

olItemTask = (_TaskItem)olTasks.GetFirst(); // First item in collection

else

olItemTask = (_TaskItem)olTasks.GetNext(); // Starts with second item in collection

if (olItemTask.Complete) // Task allredy completed

continue;

However, when the tasks are sent to the calendar they lose this prioritised order and appear in order of task name. Any ideas



Answer this question

Outlook add-in (auto-scheduler)

  • RDSC

    what is supposed to happen is that the user enters tasks in the task list of outlook and assigns a priority to them, then he presses the auto schedule button. What happens next is that the tasks should be sorted in order of priority and placed in the calendar view in this sorted order. I know the tasks are getting sorted correctly because they appear in order of priority in the task list, but when you switch to calendar they appear in the order they were entered in.
  • Hipolito Lopez

    This is just the order settings of outlook i geuss. Can you re-order them in outlook without any problems


  • Outlook add-in (auto-scheduler)