Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to instantiate an object with a generic parameter? Pin
michal.kreslik6-Feb-08 4:05
michal.kreslik6-Feb-08 4:05 
AnswerRe: How to instantiate an object with a generic parameter? Pin
Mark Churchill1-Feb-08 2:47
Mark Churchill1-Feb-08 2:47 
GeneralRe: How to instantiate an object with a generic parameter? Pin
michal.kreslik6-Feb-08 22:12
michal.kreslik6-Feb-08 22:12 
GeneralRe: How to instantiate an object with a generic parameter? [modified] Pin
Mark Churchill7-Feb-08 0:07
Mark Churchill7-Feb-08 0:07 
GeneralRefresh Pin
kibromg31-Jan-08 7:14
kibromg31-Jan-08 7:14 
GeneralRe: Refresh Pin
pmarfleet31-Jan-08 8:43
pmarfleet31-Jan-08 8:43 
Generalmarshaling an array of structs Pin
damianrda31-Jan-08 6:23
damianrda31-Jan-08 6:23 
GeneralDeleting Outlook Appointments Pin
NewToAspDotNet31-Jan-08 6:15
NewToAspDotNet31-Jan-08 6:15 
Hi All,
I have application to make and delete appointments.
Here is some code to make the appointments:

string myProp = "test";

Outlook.Application outlookApp = new Outlook.Application();
Outlook.AppointmentItem oAppointment = (Outlook.AppointmentItem)outlookApp.CreateItem (Outlook.OlItemType.olAppointmentItem);
oAppointment.Subject = "This is the subject for my appointment";
oAppointment.Body = "This is the body text for my appointment";
oAppointment.Location = "Bongerd 331";
oAppointment.Start = Convert.ToDateTime("31/01/2008 10:00:00 AM");
oAppointment.End = Convert.ToDateTime("31/01/2008 12:00:00 PM");
oAppointment.ReminderSet = true;
oAppointment.ReminderMinutesBeforeStart = 15;
oAppointment.UserProperties.Add(myProp, Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, true, System.Reflection.Missing.Value);
oAppointment.UserProperties[myProp].Value = "mijn";
oAppointment.Save();

and to delete :

String sCriteria;
string impNr = "mijn";
Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = (Outlook.NameSpace)oApp.GetNamespace("mapi");
Outlook.MAPIFolder oCalendar = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
Outlook.Items oItems = (Outlook.Items)oCalendar.Items;
sCriteria = "[test] = '" + impNr + "'";
Outlook.Items oRestrictedItems = oItems.Restrict(sCriteria);
oRestrictedItems.IncludeRecurrences = true;
Outlook.AppointmentItem oAppointment;
Outlook.AppointmentItem oAppt;
oAppt = (Outlook.AppointmentItem)oRestrictedItems.GetFirst();
oAppt = (Outlook.AppointmentItem)oRestrictedItems.GetNext();
sCriteria = "[test] = '" + impNr + "'";
oAppointment = (Outlook.AppointmentItem)oItems.Find(sCriteria);
if (oAppointment is Outlook.AppointmentItem)
{
oAppointment.Delete();
}
else
MessageBox.Show("No object found");

it works fine for one appointment, bud the problem is that for making the appointments i have to use a Foreach loop (depending on some situations)..so there wil be always made more then one appointments and they get all the same userproperty value...bud now wen i click on 'delete' it deletes only one of the maded appointments...how can i make a loop to delete all appointments with same userproperty value???? maybe some code?
thanx
GeneralNesting panels Pin
DSdragondude31-Jan-08 5:29
DSdragondude31-Jan-08 5:29 
QuestionRe: Nesting panels Pin
TJoe31-Jan-08 5:38
TJoe31-Jan-08 5:38 
GeneralMulti Colored text in a tree view. Pin
RKavanagh31-Jan-08 5:02
RKavanagh31-Jan-08 5:02 
GeneralRe: Multi Colored text in a tree view. Pin
Luc Pattyn31-Jan-08 5:26
sitebuilderLuc Pattyn31-Jan-08 5:26 
QuestionHow to make form as a model Window??? Pin
Neo Andreson31-Jan-08 4:48
Neo Andreson31-Jan-08 4:48 
AnswerRe: How to make form as a model Window??? Pin
Skippums31-Jan-08 4:53
Skippums31-Jan-08 4:53 
GeneralRe: How to make form as a model Window??? Pin
Neo Andreson31-Jan-08 17:46
Neo Andreson31-Jan-08 17:46 
GeneralText Box Selection Pin
StyleGuide31-Jan-08 3:36
StyleGuide31-Jan-08 3:36 
GeneralRe: Text Box Selection Pin
CKnig31-Jan-08 3:46
CKnig31-Jan-08 3:46 
GeneralRe: Text Box Selection Pin
StyleGuide31-Jan-08 4:37
StyleGuide31-Jan-08 4:37 
GeneralRe: Text Box Selection Pin
Skippums31-Jan-08 4:52
Skippums31-Jan-08 4:52 
GeneralRe: Text Box Selection Pin
StyleGuide31-Jan-08 22:47
StyleGuide31-Jan-08 22:47 
GeneralRe: Text Box Selection Pin
Skippums1-Feb-08 0:11
Skippums1-Feb-08 0:11 
GeneralRe: Text Box Selection Pin
StyleGuide1-Feb-08 4:29
StyleGuide1-Feb-08 4:29 
GeneralRe: Text Box Selection Pin
Skippums1-Feb-08 5:31
Skippums1-Feb-08 5:31 
GeneralRe: Text Box Selection Pin
StyleGuide4-Feb-08 5:56
StyleGuide4-Feb-08 5:56 
Generalprogram disables the application Pin
Saamir31-Jan-08 3:28
Saamir31-Jan-08 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.