rujuta_l
2009-07-09 10:30:49 UTC
Hello,
We are trying to create task in tasks folder of outlook using outlook object
model in ASp.net2.0 web application. The code is like this
Dim oApp As Outlook.Application = New Outlook.Application()
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi") '
oNS.Logon(txtAdmineMailID.Text, txtAdminPwd.Text, True, True)
Dim OTask As Outlook.TaskItem =
oApp.CreateItem(Outlook.OlItemType.olTaskItem)
OTask.Assign()
OTask.Recipients.Add(txteMailID.Text)
OTask.Subject = txtSub.Text
OTask.Body = txtMsg.Text
OTask.DueDate = DateTime.Today
OTask.ReminderTime = OTask.DueDate
OTask.Send()
The code works fine if run locally on windows 2003 server
(http://localhost/CreateTask/test.aspx) provided outlook on the win2003
server configured properly and is open. Task gets created in task folder of
email account provided in txtemail.text by email account provided in
txtAdmineMailID.Text
In following two cases, the above code does not work.
1. If the outlook on win2003 is not open, task does not get created even if
run locally.
2. If the application is run remotely from some other machine using the url
http://abc2003/CreateTask/test.aspx (abc2003 is the name of server where the
createTask app resides), keeping outook on server open, we get the following
error for 1st line of code
Dim oApp As Outlook.Application = New Outlook.Application()
Error is
Retrieving the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following error:
80070005.
We need to create the task remotely and without keeping outlook open. Pl.
suggest the solution.
thanks in advance.
We are trying to create task in tasks folder of outlook using outlook object
model in ASp.net2.0 web application. The code is like this
Dim oApp As Outlook.Application = New Outlook.Application()
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi") '
oNS.Logon(txtAdmineMailID.Text, txtAdminPwd.Text, True, True)
Dim OTask As Outlook.TaskItem =
oApp.CreateItem(Outlook.OlItemType.olTaskItem)
OTask.Assign()
OTask.Recipients.Add(txteMailID.Text)
OTask.Subject = txtSub.Text
OTask.Body = txtMsg.Text
OTask.DueDate = DateTime.Today
OTask.ReminderTime = OTask.DueDate
OTask.Send()
The code works fine if run locally on windows 2003 server
(http://localhost/CreateTask/test.aspx) provided outlook on the win2003
server configured properly and is open. Task gets created in task folder of
email account provided in txtemail.text by email account provided in
txtAdmineMailID.Text
In following two cases, the above code does not work.
1. If the outlook on win2003 is not open, task does not get created even if
run locally.
2. If the application is run remotely from some other machine using the url
http://abc2003/CreateTask/test.aspx (abc2003 is the name of server where the
createTask app resides), keeping outook on server open, we get the following
error for 1st line of code
Dim oApp As Outlook.Application = New Outlook.Application()
Error is
Retrieving the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following error:
80070005.
We need to create the task remotely and without keeping outlook open. Pl.
suggest the solution.
thanks in advance.