Board index » Visual Studio » Bew task in MS Outlook

Bew task in MS Outlook

Visual Studio164
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.


-
 

Re:Bew task in MS Outlook

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.



On Sat, 17 Jul 2004 16:09:24 GMT, jason@no-spam.dive-master.org (Jason

L James) wrote:



Quote
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.



-