473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Retrieving OL Calendar items from ASP.NET ...

Good Morning all,

I need to interoperate with the Calendar of MS Outlook 2003
(inserting, retrieving,
listing events, etc. etc.) from an ASP.NET application; I first
developed a simple
windows application in C# and it worked fine, I added the OL reference
and created
the COM object with the following code:

Outlook.Application app = new Outlook.Application();
Outlook.MAPIFolder folder =
app.GetNamespace("MAPI").GetDefaultFolder(Outlook. OlDefaultFolders.olFolderCalendar);
System.Collections.IEnumerator ie = folder.Items.GetEnumerator();
....

The problem is that, when I write the *same* code into an ASP.NET app,
*in spite
of in debugging mode everything works* (I use MS VS 2008), when I
deploy my
app on IIS (on the same developing machine!) I always get the
following error:

Retrieving the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following
error: 80080005.
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.InteropServices.COMException:
Retrieving the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following
error: 80080005.
.....

I tried almost everything, setting all the possible user and
permissions, using
DCOMCNFG, etc. looking on the net and it seems that many people have
the
same problem, but no solutions ...

Is it possible to create a COM object instance (CoCreateInstance)
inside an
ASP.NET app ?

Thank you in advance for your help ...

Bruno
Sep 22 '08 #1
3 2147
"Bruno Vignola" <br***********@gmail.comwrote in message
news:e3**********************************@l43g2000 hsh.googlegroups.com...
Outlook.Application app = new Outlook.Application();

The problem is that, when I write the *same* code into an ASP.NET app,

I always get the following error:
<snip>

Yes, that is one of the (many) errors that you are likely to get in this
situation...
Is it possible to create a COM object instance (CoCreateInstance)
inside an ASP.NET app ?
Yes it is, so long as the COM object that you are tying to instantiate is
designed to be instantiated in this way.

Microsoft Office isn't designed to be instantiated in this way. In fact,
Microsoft do not recommend this type of server-side Office automation at
all, and won't support any solution which attempts to use it:
http://support.microsoft.com/default...US;q257757#kb2
http://support.microsoft.com/default.aspx/kb/288367

Presumably, the local copies of Microsoft Outlook are all using Microsoft
Exchange Server? If so, then you will need to code your ASP.NET solution to
interrogate Exchange instead. This is not particularly difficult, and there
are hundreds of examples on the web:
http://www.google.co.uk/search?sourc...ET%22+Exchange
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 22 '08 #2
On 22 Set, 13:43, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:

Hello Mark,
Microsoft Office isn't designed to be instantiated in this way.
I supposed that ... :-( .. I read that Microsoft do not recommend that
solution.
Presumably, the local copies of Microsoft Outlook are all using Microsoft
Exchange Server?
yes they do, it is the server of my company.
If so, then you will need to code your ASP.NET solution to
interrogate Exchange instead. This is not particularly difficult, and there
are hundreds of examples on the web:http://www.google.co.uk/search?
sourceid=navclient&hl=en-GB&ie=UTF-8&r...
thank you very much for your suggestion, it has been very useful to
avoid me wasting time on the wrong way, I will try to investigate your
proposal !

thank you very much again !

Bruno
Sep 22 '08 #3
On 22 Set, 13:43, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:

Hello Mark :)

just wanted u to know that, basing on your suggestion and on this
useful example: http://blog.downtownsoftwarehouse.com/2006/10/26/
using-net-and-webdav-to-access-an-exchange-server/, I have been able
to do in a few hours a small prototype of my app, working fine, using
WebDAV for accessing the exchange server.

thank you very much again!

Bruno
Sep 23 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dave Hopper | last post by:
Hi I am using the following SQL to retrieve a value in a list box using a unique ID held in the list box call cntID. The list box is used on an order form to list appointments that have been...
5
by: Miguel Dias Moura | last post by:
Hello, i am trying to create a .css file with several styles and apply them to the calendar control so i can change the look of: 1. Text Type and Format (Bold, Underline, etc) 2. Background...
1
by: bill yeager | last post by:
I would like to place the currently selected date (retrieved from the database) on a calendar control which is embedded inside a datagrid. However, I can't find the ID of the control to do so....
2
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many...
3
by: Hutty | last post by:
I'm trying create a calendar control that updates an access database with events. I have some code I managed to piece together. First error I'm running into is the Mycommand.ExecuteNonQuery(). I...
0
by: Elmo Watson | last post by:
I'm using a database to enter calendar items, using the ASP.Net calendar - I've got it working with one item per date, using code on the net - - it's using a datareader to read the items, then...
6
by: Zeba | last post by:
Hi, I have a page with a calendar and two datalist items - one containing month values and the other, year values. Depending on the month/year value chosen ( in text/string format ) I should be...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
1
by: macupryk | last post by:
I have been looking for code to show a dropdownlist date for a person to select there date of birth without calendar. I have the below code but if there is some code in Ajax Javascript I will use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.