Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

below is my code.

//Code of the task
Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();



Microsoft.Office.Interop.Outlook.TaskItem oTask = (Microsoft.Office.Interop.Outlook.TaskItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olTaskItem);

oTask.Subject = "This is my task subject";

oTask.DueDate = Convert.ToDateTime("06/29/2006");

oTask.StartDate = Convert.ToDateTime("06/28/2006");

oTask.ReminderSet = true;

oTask.ReminderTime = Convert.ToDateTime("06/28/2006 02:40:00 PM");

oTask.Body = "This is the task body";

oTask.SchedulePlusPriority = "High";

oTask.Status =Microsoft.Office.Interop.Outlook.OlTaskStatus.olTaskInProgress;

oTask.Save();



//Send task via email
Microsoft.Office.Interop.Outlook.Recipients oRecipients = oTask.Recipients;

Microsoft.Office.Interop.Outlook.Recipient oReceipient;

oReceipient = oRecipients.Add("FirstName1.LastName@Server.com");

oReceipient = oRecipients.Add("FirstName2. LastName@Server.com");

oReceipient = oRecipients.Add("FirstName3. LastName@Server.com");

oReceipient.Type = 1;

oRecipients.ResolveAll();

oTask.Assign();

oTask.Send();

when i run the above code, it is going to users as emil format, it is not going Task format. Can u plz help how to send to users as a Task format for sending the Tasks from application.
Posted
Updated 31-Jan-10 21:25pm

Sending an email is trivial, I assume you know this. ASP.NET is a framework for creating web pages, it is a library that sits on top of .NET. It cannot interact with Outlook, but the underlying framework can. The issue is, if you don't tell us what language you're using, we don't know what language to help you in.

There's this new thing on the interwebs, it's called google. Check <a href="http://www.bing.com/search?q=outlook+task+create+VB.NET&src=IE-SearchBox&Form=IE8SRC">this</a>[<a href="http://www.bing.com/search?q=outlook+task+create+VB.NET&src=IE-SearchBox&Form=IE8SRC" target="_blank" title="New Window">^</a>] out. I suspect your server will need to have Outlook installed, in order for you to iteract with it, then you can send the file that represents the task via email. Yes, I clicked the first hit on my search, and sure enough, the code requires outlook. That first article assumes you're saving the task into outlook, so you may need to dig a little more, or use intellisense to see where the export option is.
 
Share this answer
 
To move forward, you can take sample, understand from the below link too:
Import and Export Outlook Appointments (using JavaScript)[^]
 
Share this answer
 
Hi All,

The Same code i am using in my application. and keep getting error. The error is
""Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154.""

I think this may be a problem with version . I am using Outlook express 6 in my computer.

But I need to done with this version only..

Please help me out?.....

Thanks & Regards,
btechathi
 
Share this answer
 
Comments
[no name] 4-Jul-12 10:38am    
How exactly is this an answer to this over 2 year old question?
hi Athikesavan,

Kill All instance of Outlook from task manager and then try it,

May this will help

Thanks and Regards,
Maruf Alam
 
Share this answer
 
v2
Comments
Deepu S Nair 5-Feb-15 5:43am    
Answering old questions will attract downvoting.Its not a good idea

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900