Bew task in MS Outlook

  • Thread starter Thread starter Jason L James
  • Start date Start date
J

Jason L James

Hi All,

does anyone have the sequence of commands
to add a new task to an outlook task list using
the outlook Object Model.

I've tried a few things but I can't ssem to get
it quite right.

He is what I have so far.

Dim oNS As Outlook.NameSpace = outlookApp.GetNamespace("mapi")
oNS.Logon([profileName], Missing.Value, False, True)
Dim oTask As Outlook.TaskItem =
outlookApp.CreateItem(Outlook.OlItemType.olTaskItem)
oTask.Subject = "Test Task"
oTask.StartDate = "18/07/2004"
oTask.Owner = "james, jason"
oTask.Assign()
oTask.Send()
oTask = Nothing
oNS = Nothing


Thanks,

Jason.
 
I managed to find what I was looking for in
the outlook VBA help and ported it
to VB.NET as follows:

Dim oNS As Outlook.NameSpace = outlookApp.GetNamespace("mapi")
oNS.Logon("Corporate Email", Missing.Value, False, True)
Dim oTask As Outlook.TaskItem =
outlookApp.CreateItem(Outlook.OlItemType.olTaskItem)
oTask.Assign()
Dim myDelegate As Outlook.Recipient =
oTask.Recipients.Add("james, jason")
oTask.Subject = "Complete Project Plan"
oTask.DueDate = "19/07/2004"
oTask.Owner = "james, jason"
oTask.Send()
oTask = Nothing
oNS = Nothing

Thanks,

Jason.
 
Back
Top