A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

COMException



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 17th 07, 06:35 PM posted to microsoft.public.outlook.program_vba
Jennifer
external usenet poster
 
Posts: 7
Default COMException

I will not be running this on an Exchange server. I have built a web
application that accesses a Shared Outlook Calendar that sits on an Exchange
Server. I have downloaded the PIA's for Office 2003 and added the COM
reference to the project. I do not understand this error. It seems to
error on this line: Outlook.Application oApp = new
Outlook.ApplicationClass();

The rest of the code is as follows:

// Get the Mapi NameSpace and the Logon.

Outlook.NameSpace oNS = (Outlook.NameSpace)oApp.GetNamespace("MAPI");



// Log on using dialog to choose a profile.

oNS.Logon(Missing.Value, Missing.Value, true, true);



Outlook.MAPIFolder olFolder = oNS.Folders["Public Folders"].Folders["All
Public Folders"].Folders["SRCPA Office Calender"];



// Define the string for the search criteria.

Outlook.Items oItems = olFolder.Items;



// Use the Find method to get single match.

string sFilter;

sFilter = "[Start] = '04/11/2007 11:59 PM' and [End] '04/11/2007 12:00
AM' and [Subject] = 'Troy Out'";

Outlook.AppointmentItem oAppt =
(Outlook.AppointmentItem)oItems.Find(sFilter);



Please help me understand what I have done wrong.

Thank you!




"Ken Slovak - [MVP - Outlook]" wrote in message
...
Right, the localhost server is local but that may not be the deployment
target. However, in any case the code should not be run server side, as
Dmitry also indicated.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dmitry Streblechenko" wrote in message
...
I think she means that both the IIS and server and the client are on the
same machine.
Since this is C#, and IE does not run any .Net code the way it runs VB
and Java Scrips, I suspect that the code is actually executed in the IIS
server context (which is a service), and no Office app (inclusing
Outlook) should be used in any Windows service.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool




  #2  
Old April 17th 07, 07:16 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default COMException

The question is not whether your code is running on an Exchange Server, but
whether you are using the Outlook Object Model from a Windows *Service* (not
Server).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Jennifer" wrote in message
...
I will not be running this on an Exchange server. I have built a web
application that accesses a Shared Outlook Calendar that sits on an
Exchange Server. I have downloaded the PIA's for Office 2003 and added the
COM reference to the project. I do not understand this error. It seems to
error on this line: Outlook.Application oApp = new
Outlook.ApplicationClass();

The rest of the code is as follows:

// Get the Mapi NameSpace and the Logon.

Outlook.NameSpace oNS = (Outlook.NameSpace)oApp.GetNamespace("MAPI");



// Log on using dialog to choose a profile.

oNS.Logon(Missing.Value, Missing.Value, true, true);



Outlook.MAPIFolder olFolder = oNS.Folders["Public Folders"].Folders["All
Public Folders"].Folders["SRCPA Office Calender"];



// Define the string for the search criteria.

Outlook.Items oItems = olFolder.Items;



// Use the Find method to get single match.

string sFilter;

sFilter = "[Start] = '04/11/2007 11:59 PM' and [End] '04/11/2007 12:00
AM' and [Subject] = 'Troy Out'";

Outlook.AppointmentItem oAppt =
(Outlook.AppointmentItem)oItems.Find(sFilter);



Please help me understand what I have done wrong.

Thank you!




"Ken Slovak - [MVP - Outlook]" wrote in message
...
Right, the localhost server is local but that may not be the deployment
target. However, in any case the code should not be run server side, as
Dmitry also indicated.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dmitry Streblechenko" wrote in message
...
I think she means that both the IIS and server and the client are on the
same machine.
Since this is C#, and IE does not run any .Net code the way it runs VB
and Java Scrips, I suspect that the code is actually executed in the IIS
server context (which is a service), and no Office app (inclusing
Outlook) should be used in any Windows service.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool






  #3  
Old April 17th 07, 08:06 PM posted to microsoft.public.outlook.program_vba
Jennifer
external usenet poster
 
Posts: 7
Default COMException

I am sorry, I know this is probably a dumb question, but this is all new to
me. I am using Outlook Object Model but I do not know if it is from a
Windows Service because it comes from the COM references in Visual
Studio.NET.

The project we have created takes user input to fill out an ASP.NET web
form. When the button click event occurs, the appointment item is written
to a Shared Outlook Calendar. I currenly am using Outlook 2003 and Visual
Studio 2005.

"Dmitry Streblechenko" wrote in message
...
The question is not whether your code is running on an Exchange Server,
but whether you are using the Outlook Object Model from a Windows
*Service* (not Server).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Jennifer" wrote in message
...
I will not be running this on an Exchange server. I have built a web
application that accesses a Shared Outlook Calendar that sits on an
Exchange Server. I have downloaded the PIA's for Office 2003 and added
the COM reference to the project. I do not understand this error. It
seems to error on this line: Outlook.Application oApp = new
Outlook.ApplicationClass();

The rest of the code is as follows:

// Get the Mapi NameSpace and the Logon.

Outlook.NameSpace oNS = (Outlook.NameSpace)oApp.GetNamespace("MAPI");



// Log on using dialog to choose a profile.

oNS.Logon(Missing.Value, Missing.Value, true, true);



Outlook.MAPIFolder olFolder = oNS.Folders["Public Folders"].Folders["All
Public Folders"].Folders["SRCPA Office Calender"];



// Define the string for the search criteria.

Outlook.Items oItems = olFolder.Items;



// Use the Find method to get single match.

string sFilter;

sFilter = "[Start] = '04/11/2007 11:59 PM' and [End] '04/11/2007 12:00
AM' and [Subject] = 'Troy Out'";

Outlook.AppointmentItem oAppt =
(Outlook.AppointmentItem)oItems.Find(sFilter);



Please help me understand what I have done wrong.

Thank you!




"Ken Slovak - [MVP - Outlook]" wrote in message
...
Right, the localhost server is local but that may not be the deployment
target. However, in any case the code should not be run server side, as
Dmitry also indicated.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dmitry Streblechenko" wrote in message
...
I think she means that both the IIS and server and the client are on the
same machine.
Since this is C#, and IE does not run any .Net code the way it runs VB
and Java Scrips, I suspect that the code is actually executed in the
IIS server context (which is a service), and no Office app (inclusing
Outlook) should be used in any Windows service.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool







  #4  
Old April 17th 07, 08:20 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default COMException

ASP runs under IIS, which is a Windows service.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Jennifer" wrote in message
...
I am sorry, I know this is probably a dumb question, but this is all new to
me. I am using Outlook Object Model but I do not know if it is from a
Windows Service because it comes from the COM references in Visual
Studio.NET.

The project we have created takes user input to fill out an ASP.NET web
form. When the button click event occurs, the appointment item is written
to a Shared Outlook Calendar. I currenly am using Outlook 2003 and Visual
Studio 2005.

"Dmitry Streblechenko" wrote in message
...
The question is not whether your code is running on an Exchange Server,
but whether you are using the Outlook Object Model from a Windows
*Service* (not Server).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Jennifer" wrote in message
...
I will not be running this on an Exchange server. I have built a web
application that accesses a Shared Outlook Calendar that sits on an
Exchange Server. I have downloaded the PIA's for Office 2003 and added
the COM reference to the project. I do not understand this error. It
seems to error on this line: Outlook.Application oApp = new
Outlook.ApplicationClass();

The rest of the code is as follows:

// Get the Mapi NameSpace and the Logon.

Outlook.NameSpace oNS = (Outlook.NameSpace)oApp.GetNamespace("MAPI");



// Log on using dialog to choose a profile.

oNS.Logon(Missing.Value, Missing.Value, true, true);



Outlook.MAPIFolder olFolder = oNS.Folders["Public Folders"].Folders["All
Public Folders"].Folders["SRCPA Office Calender"];



// Define the string for the search criteria.

Outlook.Items oItems = olFolder.Items;



// Use the Find method to get single match.

string sFilter;

sFilter = "[Start] = '04/11/2007 11:59 PM' and [End] '04/11/2007
12:00 AM' and [Subject] = 'Troy Out'";

Outlook.AppointmentItem oAppt =
(Outlook.AppointmentItem)oItems.Find(sFilter);



Please help me understand what I have done wrong.

Thank you!




"Ken Slovak - [MVP - Outlook]" wrote in message
...
Right, the localhost server is local but that may not be the deployment
target. However, in any case the code should not be run server side, as
Dmitry also indicated.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dmitry Streblechenko" wrote in message
...
I think she means that both the IIS and server and the client are on
the same machine.
Since this is C#, and IE does not run any .Net code the way it runs VB
and Java Scrips, I suspect that the code is actually executed in the
IIS server context (which is a service), and no Office app (inclusing
Outlook) should be used in any Windows service.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool









 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.