|
|
|
date: Fri, 9 Jun 2006 11:08:02 -0700,
group: microsoft.public.exchange2000.development
back
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
|
|