You have to install outlook on the server 'cause the code is executed server side. But then you'll add the task to the account used in Outlook on the server.
Main Topics
Browse All TopicsHi,
I'm writing an ASP.NET application for our staff to use through their webbrowsers.
I want to let them click on a button and have a task added to their Outlook Tasks folder. I've tried using this code behind an ASP button but it comes back with an error:
Dim ol As Outlook.Application
Dim NewTask As Outlook.TaskItem
' Set the Application object.
ol = New Outlook.Application()
' Create a new standard task.
NewTask = ol.CreateItem(Outlook.OlIt
NewTask.Subject = "Automatic Task Creation"
NewTask.DueDate = CDate("21/12/2002")
NewTask.ReminderSet = False
NewTask.Save()
ERROR RETURNED:
COM object with CLSID {0006F03A-0000-0000-C000-0
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServ
I guess as the code is in an ASPX application that it is running server-side and hence Outlook is not available.
Can anyone suggest how I can do this? I know the code works as I have tested that snippet in a Windows Form Application okay.
Regards,
Andrew Doyle
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: davekyPosted on 2002-12-17 at 05:56:49ID: 7595105
You cannot do anything to the client machine from the server for very good reasons. You could have clients use exchange as their data store on the server and then you could do what you want (on the server). The windows app works as it runs on the client. To accomplish what you want you wil need an "activex" type control in the browser. It is possible to run downloaded .net windows apps in the browser (ie .exes). There are questio posted on ee about this. If I can find one I'll post a link.