PC Review


Reply
Thread Tools Rate Thread

Adding to Outlook Task List with VB .net

 
 
=?Utf-8?B?SW1yeQ==?=
Guest
Posts: n/a
 
      14th Nov 2004
Is there a way to programatically add items to the outlook task list using VB
..net?
 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      14th Nov 2004
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

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

"Imry" <(E-Mail Removed)> wrote in message
news:BFBC7E20-01C0-4611-A8D1-(E-Mail Removed)...
Is there a way to programatically add items to the outlook task list using
VB
..net?


 
Reply With Quote
 
=?Utf-8?B?SW1yeQ==?=
Guest
Posts: n/a
 
      14th Nov 2004
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.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
>
> -----------------------
>
> "Imry" <(E-Mail Removed)> wrote in message
> news:BFBC7E20-01C0-4611-A8D1-(E-Mail Removed)...
> Is there a way to programatically add items to the outlook task list using
> VB
> ..net?
>
>
>

 
Reply With Quote
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      14th Nov 2004
Hi,

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

Ken
----------------------
"Imry" <(E-Mail Removed)> wrote in message
news:0DB1967D-0103-493C-A32E-(E-Mail Removed)...
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.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
>
> -----------------------
>
> "Imry" <(E-Mail Removed)> wrote in message
> news:BFBC7E20-01C0-4611-A8D1-(E-Mail Removed)...
> Is there a way to programatically add items to the outlook task list using
> VB
> ..net?
>
>
>



 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      15th Nov 2004
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" <(E-Mail Removed)> wrote in message
news:BFBC7E20-01C0-4611-A8D1-(E-Mail Removed)...
> Is there a way to programatically add items to the outlook task list using
> VB
> .net?



 
Reply With Quote
 
=?Utf-8?B?SW1yeQ==?=
Guest
Posts: n/a
 
      19th Nov 2004
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?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 - Task Window - My Task,To-Do list strains CPU Victoria@DIG Microsoft Outlook Discussion 0 3rd Oct 2008 05:20 PM
Outlook XP Task Master Catagory List not available with 2003 task =?Utf-8?B?Q29tcGRlYg==?= Microsoft Outlook Discussion 1 25th Jul 2005 08:53 PM
Outlook message to add Task to Task-List, Automatically? Microsoft Outlook VBA Programming 1 30th Aug 2004 11:05 PM
Column Views in Task List - Adding & Displaying =?Utf-8?B?Q2hyaXMgQmxha2U=?= Microsoft Outlook Contacts 1 19th Apr 2004 09:21 PM
Empty Task keeps adding up in my Outlook Task folder Patrick Microsoft Outlook 0 29th Mar 2004 07:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:10 AM.