How to create obj: "New Outlook.Application" in ASP.NET? (simple)

H

HvG

I'm sure this is a trivial question, but I cannot create an Outlook Object
from a WebForm app, but can from a console app. or a Windows app. My COM
knowledge is very poor sorry.

Code-----------------------------------------------------------------------------------
Dim oApp As Outlook.Application = New Outlook.Application
....
-----------------------------------------------------------------------------------
Exception Details: System.Exception: Cannot create ActiveX component.

A reference to "Microsoft Outlook 10.0 Object Library" has been added, the
PC runs on XP Pro, .NET FW1.1, Outlook 2002.
Thanks for any help,

Hugo
 
K

Karl Seguin

Hugo:
First off, why not create send email via System.Web.Mail ??

Secondly, since you are using ASP.Net, the user making the request is
probably anonymous and doesn't have access to create the COM object.. You
could quickly verify this by setting <identity impersonate="true" /> in
your web.config which (depending on how IIS is set up) should make the
process run under the account of the user visiting (you) but that'll only
work in an intranet environment...unless you escalate ASP.Net's persmission
for anonymous users (bad idea)

So why not #1?

Karl
 
H

HvG

Thanks for the reply.
First off, why not create send email via System.Web.Mail ??
My desire is to be able to delete and create Contacts and read Mail Items in
public Exchange folders using the Outlook profile on the webserver
(intranet). This appeared to be quickier and easier to use than webDAV.

I did try to give the IUSER_... temporary administrator rights (without a PC
restart), but that didn't work
I will try the inpersonate idea.

Regards
Hugo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top