Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Fri, 9 Jun 2006 11:08:02 -0700,    group: microsoft.public.exchange2000.development        back       


Retrieving Calendar Appointment C#   
Hey guys,

      Would anyone mind very much giving me an example of how I can retrieve 
a calendar appointment using CDOEX? What I want to do is retrieve the 
calendar item, and then remove it. I know the date / time and the subject / 
title.

Any help would REALLY be appreciated.


Thanks!!!

Todd
date: Fri, 9 Jun 2006 11:08:02 -0700   author:   Todd Jaspers

RE: Retrieving Calendar Appointment C#   
This is what I have so far:

I HAVE all the data needed to FIND the calendar item.
I have the connection string, and can successfully make the connection.

What I'm missing is:

Now that I'm connected to my mailbox / calendar folder, how do I query it to 
find that calendar item?

Once I have found it, how do I make it the item in focus and then delete it? 
Is it just iAppointment.Cancel?



Here is my code so far:
-----------------------------------------------------------------------------------------
		// - ON DELETE EVENT -
		public void OnDelete(IExStoreEventInfo pEventInfo, string bstrURLItem, int 
lFlags)
		{
			try
			{
				ActionLog.Append("Entering save event." + "\n");
				if(System.Convert.ToBoolean(lFlags))
				{
					try
					{
						ActionLog.Append("Preparing to delete appointment." + "\n");
						CDO.Appointment iApp = new CDO.Appointment();
			
						// the last 2 arguments require the username/password of a user that 
has permissions to the event sink registrants contacts.
						iApp.DataSource.Open(bstrURLItem,null,
							ADODB.ConnectModeEnum.adModeRead,
							ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
							ADODB.RecordOpenOptionsEnum.adOpenSource,sDomain + "\\" + sUsername, 
sPassword);
						ActionLog.Append("Found: " + iApp.Subject + "." + "\n");
						ActionLog.Append("Deleting Appointment." + "\n");

						string strSubject = iApp.Subject;
						string strStartTime = iApp.StartTime;
						string strEndTime = iApp.EndTime;
						iAppt = null;


						// Personal Calendar Connection
						ADODB.Connection oCn = new ADODB.Connection();
						oCn.Provider = "exoledb.datasource";
						string sURL = "http://MDDSWEBMAIL.com/Exchange/tjaspers/calendar";
						oCn.Open(sURL, sDomain + "\\" + sUsername, sPassword, 0);  
						CDO.Configuration iConfg = new CDO.Configuration();
						ADODB.Fields oFields;


	
						//FIND AND DELETE

						
						
						oCn = null;
						oFields = null;
					}
					catch (Exception ex)
					{
						LogException(bstrURLItem, ex.ToString());
					}
					finally
					{
						LogException("Log Output", ActionLog.ToString());
					}
				}
			}
			catch (Exception ex)
			{
				LogException(bstrURLItem, ex.ToString());
			}		
		}
-----------------------------------------------------------------------------------------

Thanks!

Todd
date: Fri, 9 Jun 2006 11:49:02 -0700   author:   Todd Jaspers

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us