Adding to Outlook Task List with VB .net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to programatically add items to the outlook task list using VB
..net?
 
Hi,

Add a reference to microsoft.office.interop.outlook.

Imports Outlook = Microsoft.Office.Interop.Outlook

Imports System.Reflection

Module Module1

Sub Main()

' Create an Outlook application.

Dim oApp As Outlook.Application = New Outlook.Application



' Create a new contact item.

Dim oTsk As Outlook.TaskItem =
DirectCast(oApp.CreateItem(Outlook.OlItemType.olTaskItem), Outlook.TaskItem)

'oCt.Display(True) 'Modal

oTsk.Status = Outlook.OlTaskStatus.olTaskInProgress

oTsk.PercentComplete = 50

oTsk.Importance = Outlook.OlImportance.olImportanceHigh

oTsk.Subject = "My new task"

oTsk.Save()

' Clean up.

oApp = Nothing

oTsk = Nothing

End Sub

End Module



Ken
 
Thank you for your help, but the I do not have a reference for
microsoft.office.interop.outlook.
Where can I find it?
 
Thank you very much for your help. Both of you.
Just one more thing. What happens if I want to use my program on different
computers that have different versions of Office? Will that create a problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top