473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 11872
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jason L James | last post by:
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. ...
16
by: ML | last post by:
Is there anyway to get around the security prompt from Outlook when using the object in a vb.net winforms app? I want to be able to load the contacts lists from Outlook but each time it access it...
4
by: digger27 | last post by:
I am trying to progamatically create tasks in Outlook using VB.Net. I am using the following code: **** Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
2
by: Snig | last post by:
Hi I'm into creating a web application in C# (.NET Framework 1.1) which would list and manage the outlook tasks. If I try to do this in a Windows Application, it works fine. But there are...
4
by: Dinsdale | last post by:
I'm looking at adding scheduling features to an application and I wanted to ask the community about any experience with scheduling components, either open source like from code project or from a...
3
by: mwolowski | last post by:
Hello, I'd like to add tasks, appointments, etc using c# to outlook For example i added reference using OutLook = Microsoft.Office.Interop.Outlook; and the code: 1. ---------------------...
1
by: The Facilitator | last post by:
Hello all, I am trying to find out what the field is in Outlook that holds all the people's email addresses for when the final completed task report is sent. Where is it and how can I access it...
0
oll3i
by: oll3i | last post by:
import javax.swing.*; import java.awt.event.*; import java.util.ArrayList; import java.util.List; import java.util.concurrent.*; import java.lang.reflect.*; public class Exec1 extends JFrame...
1
by: Paul Brady | last post by:
This must be a common operation, but I have searched this newsgroup and have wrestled with the help messages, and I seem to need help with this simple task. I have an Access 2000 database which,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.