This is the simplest way for creating and sending a task
First add Reference to Microsoft 11.0 object library from Add Reference and click on COM tab.
code :
using Outlook = Microsoft.Office.Interop.Outlook;
'Create objects of ApplicationClass and TaskItem as follows :
Outlook.ApplicationClass app = new Outlook.ApplicationClass();
Outlook.TaskItem task = (Outlook.TaskItem)
app.CreateItem(Outlook.OlItemType.olTaskItem);
'Set task property :
task.StartDate = DateTime.Now;
task.DueDate = DateTime.Now;
task.Subject = "Test";
task.Body = "Testing";
task.Recipients.Add(xyz@xyz.com);
task.Assign();
task.Send();
First add Reference to Microsoft 11.0 object library from Add Reference and click on COM tab.
code :
using Outlook = Microsoft.Office.Interop.Outlook;
'Create objects of ApplicationClass and TaskItem as follows :
Outlook.ApplicationClass app = new Outlook.ApplicationClass();
Outlook.TaskItem task = (Outlook.TaskItem)
app.CreateItem(Outlook.OlItemType.olTaskItem);
'Set task property :
task.StartDate = DateTime.Now;
task.DueDate = DateTime.Now;
task.Subject = "Test";
task.Body = "Testing";
task.Recipients.Add(xyz@xyz.com);
task.Assign();
task.Send();
Ohh! This is great. Keep going.
ReplyDelete