469,331 Members | 1,877 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

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

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
Nov 19 '05 #1
2 2407
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" <hv*****@hotmail.com> wrote in message
news:eh*************@tk2msftngp13.phx.gbl...
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

Nov 19 '05 #2
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

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OT**************@TK2MSFTNGP10.phx.gbl... 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" <hv*****@hotmail.com> wrote in message
news:eh*************@tk2msftngp13.phx.gbl...
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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

24 posts views Thread by Rv5 | last post: by
9 posts views Thread by Marc Miller | last post: by
24 posts views Thread by M O J O | last post: by
2 posts views Thread by Gabriele *darkbard* Farina | last post: by
reply views Thread by kennedystephen | last post: by
reply views Thread by kennedystephen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.