PC Review


Reply
Thread Tools Rate Thread

How to create a task item programatically

 
 
=?Utf-8?B?UmFtw7Nu?=
Guest
Posts: n/a
 
      19th Mar 2005
why am I not allowed to intanstiate a new task item?

TaskItem task_DC = new TaskItemClass();

This is the erro I get when building:

error CS0122:
'Microsoft.Office.Interop.Outlook.TaskItemClass.TaskItemClass()' is
inaccessible due to its protection level


 
Reply With Quote
 
 
 
 
Rodger Constandse
Guest
Posts: n/a
 
      20th Mar 2005
Hi,

To create an Outlook task item programatically, you need to use the Outlook
application object's CreateItem method and pass in the OlItemType.olTaskItem
constant.

TaskItem task_DC = (TaskItem) myOutlookApp.CreateItem(OlItemType.olTaskItem)

you can also create it by using the Add method in the items collection of a task
folder where you want the new task item to reside.

// assuming that tasks contains the MAPIFolder for the Outlook tasks obtained
from the namespace object

TaskItem task_DC = (TaskItem) tasks.Items.Add(OlItemType.olTaskItem);

Hope this helps.

--
Rodger Constandse

<http://www.SequenceDiagramEditor.com>
Sequence Diagram Editor - A quick and easy way to draw and edit sequence diagrams

Ramón wrote:

> why am I not allowed to intanstiate a new task item?
>
> TaskItem task_DC = new TaskItemClass();
>
> This is the erro I get when building:
>
> error CS0122:
> 'Microsoft.Office.Interop.Outlook.TaskItemClass.TaskItemClass()' is
> inaccessible due to its protection level
>
>

 
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
Create a Task or Calendar Item from an Email =?Utf-8?B?U0pU?= Microsoft Outlook Discussion 3 16th Aug 2006 02:40 AM
Re: create outlook task item from asp .net Daniel Fisher\(lennybacon\) Microsoft ASP .NET 0 12th Jul 2005 03:33 PM
create outlook task item from asp .net =?Utf-8?B?V2lsbGlhbQ==?= Microsoft ASP .NET 0 12th Jul 2005 09:23 AM
How to create new task item? Sue Mosher [MVP] Microsoft Outlook Interoperability 1 27th Oct 2003 11:36 AM
Add toolbox item programatically Christina Androne Microsoft C# .NET 7 26th Oct 2003 09:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:31 PM.