473,659 Members | 2,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create a task item programatically

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.Offi ce.Interop.Outl ook.TaskItemCla ss.TaskItemClas s()' is
inaccessible due to its protection level
Nov 16 '05 #1
1 7098
Hi,

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

TaskItem task_DC = (TaskItem) myOutlookApp.Cr eateItem(OlItem Type.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.olT askItem);

Hope this helps.

--
Rodger Constandse

<http://www.SequenceDia gramEditor.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.Offi ce.Interop.Outl ook.TaskItemCla ss.TaskItemClas s()' is
inaccessible due to its protection level

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4436
by: Attila | last post by:
Hi. I am looking for a site or some coding ideas to run specific subs or programs at certain times and/or dates. For example, I would like to automate pulling data via ADO(.NET) at 6 am, on the 21st of every month. The only thing that I could think of was to set a timer control to fire every few seconds to check date and time. I was hoping there was a better way to do this without using the Task Scheduler or a product such as
7
5202
by: pintihar | last post by:
Hi, As a follow on from an earlier post I have another question about xslt. Is it possible to create the stylsheet programatically? Is this sensible? In the first phase I needed to map element name from inbound xml to my internal elements to standardize disparate input. Now I could just create an xslt stylesheet for each possible inbound format and be done, but I think it would be powerful to be able store this mapping in a database and...
6
1511
by: Mythran | last post by:
I have 2 projects, a Web project and a Class Library project. In the class project, I have a class called Class1. Pseudo below: Class Class1 ... Public Static Sub Generate() If True ' Create Page and display to user. End If End Sub
0
1370
by: William | last post by:
Hi there, Is there anybody here who ever create outlook task item from asp .net script successfully ? Actually I've created the script for creating the task, and it run successfully from the local computer using the admin login, but if I try to access the page who created the outlook task item from remote computer, and also using the admin login, it will fail. Below is one of the error message that I've got,
4
10749
by: mabond | last post by:
Does anyone know some code that will allow me to enable and/or disable a task which already exists in the task scheduer. I have a task which runs at 15 min intervals and from time to time I want to disable (and later enable) that task. I'd like to do so programatically as part of another application instead of opening the task scheduler and right clicking on the relevant task. Any guidance or suggestions for code would be appreciated ...
5
2378
by: | last post by:
I have a menu with three top level item "red", "green", "blue". I want, programatically, to add under "grren" "light green" ? tnx
4
3322
by: Jan | last post by:
Have an SQL create/import script. Running this on SQL would make it create a table with some values. Can Access2003 somehow use such and SQL script? I went into SQL query view to try it out, but the amount of data was too big to paste in according to Access. Sample data: -- -- PostgreSQL database dump
2
1967
by: Matthias Langbein | last post by:
Hi all, is there an event raised when the task pane is changed from visible to invisible and vice versa? And how can I trigger this event? Thx, Langi
7
6748
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review my code and tell me how to fix it. Thanks The Mad Ape
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8339
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.