Connecting Tech Pros Worldwide Forums | Help | Site Map

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

HvG
Guest
 
Posts: n/a
#1: Nov 19 '05
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



Karl Seguin
Guest
 
Posts: n/a
#2: Nov 19 '05

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


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

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)


"HvG" <hvg2000@hotmail.com> wrote in message
news:ehhYK26JFHA.904@tk2msftngp13.phx.gbl...[color=blue]
> 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.
>
>[/color]
Code------------------------------------------------------------------------
-----------[color=blue]
> Dim oApp As Outlook.Application = New Outlook.Application
> ...
> --------------------------------------------------------------------------[/color]
---------[color=blue]
> 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
>
>[/color]


HvG
Guest
 
Posts: n/a
#3: Nov 19 '05

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


Thanks for the reply.[color=blue]
> First off, why not create send email via System.Web.Mail ??[/color]
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

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OTtegr9JFHA.1052@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
>
>
> "HvG" <hvg2000@hotmail.com> wrote in message
> news:ehhYK26JFHA.904@tk2msftngp13.phx.gbl...[color=green]
>> 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.
>>
>>[/color]
> Code------------------------------------------------------------------------
> -----------[color=green]
>> Dim oApp As Outlook.Application = New Outlook.Application
>> ...
>> --------------------------------------------------------------------------[/color]
> ---------[color=green]
>> 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
>>
>>[/color]
>
>[/color]


Closed Thread


Similar ASP.NET bytes