469,306 Members | 1,797 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Adding to Outlook Task List with VB .net

Is there a way to programatically add items to the outlook task list using VB
..net?
Nov 21 '05 #1
5 11508
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.olTa skItem), 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

-----------------------

"Imry" <Im**@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Is there a way to programatically add items to the outlook task list using
VB
..net?
Nov 21 '05 #2
Thank you for your help, but the I do not have a reference for
microsoft.office.interop.outlook.
Where can I find it?

"Ken Tucker [MVP]" wrote:
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.olTa skItem), 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

-----------------------

"Imry" <Im**@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Is there a way to programatically add items to the outlook task list using
VB
..net?

Nov 21 '05 #3
Hi,

http://support.microsoft.com/default...b;en-us;827476

Ken
----------------------
"Imry" <Im**@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
Thank you for your help, but the I do not have a reference for
microsoft.office.interop.outlook.
Where can I find it?

"Ken Tucker [MVP]" wrote:
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.olTa skItem),
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

-----------------------

"Imry" <Im**@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Is there a way to programatically add items to the outlook task list using
VB
..net?

Nov 21 '05 #4
Imry,
In addition to Ken's comments:

The following site provides a good place to start on articles about using
Outlook & .NET.

http://www.microeye.com/resources/res_outlookvsnet.htm

Hope this helps
Jay

"Imry" <Im**@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Is there a way to programatically add items to the outlook task list using
VB
.net?

Nov 21 '05 #5
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?

"Imry" wrote:
Is there a way to programatically add items to the outlook task list using VB
.net?

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jason L James | last post: by
16 posts views Thread by ML | last post: by
4 posts views Thread by digger27 | last post: by
2 posts views Thread by Snig | last post: by
4 posts views Thread by Dinsdale | last post: by
3 posts views Thread by mwolowski | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.