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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Outlook won't create the exception-objects on a recurring appointment
Hi,
I'm developing a .NET-application (C#) which must be able to synchronise the outlook-agenda with the agenda of another application. I'm using the official primary interop assembly for outlook (v11) which works fine. For the synchronisation to work, I must, for example, be able to change the recurrence pattern of an appointment or programmatically add some exceptions to the pattern. I have looked at several examples and it doesn't seem to be very hard: - get the main item/appointment - get it's recurrence pattern - get the occurrence on a specified date - delete this occurrence, or change this occurrence's properties and save it To be more specific, this is some of the code I've written: Code:
MSOutlook.AppointmentItem item = _appointment.GetRecurrencePattern().GetOccurrence(exc.OriginalDate); if (item != null) item.Delete(); ..... _appointment.Save(); one) from the other application. The code executes fine; while debugging, ''item" gets a valid value, item.Delete() is executed and finally the main appointment is saved. The problem is, and I'm really stuck here, that the Exception-list of the recurrence-pattern doesn't get filled: _appointment.GetRecurrencePattern().Exceptions.Cou nt stays 0! Needless to say, nothing changes in the Outlook-view as well. Deleting or changing occurrences via Outlook's own interface works fine. Am I forgetting some trivial steps when saving or deleting single occurrences of the pattern? If so, the examples I've seen msut be flawed as wel, since I'm almost literally doing the same; the only difference is that most examples are macros of Outlook and are written in VBA, while I'm programming C# and using Outlook's PIA. By the way, I'm testing/debugging on Outlook 2003. |
Ads |
#2
|
|||
|
|||
Outlook won't create the exception-objects on a recurring appointment
I think I'm closing to the error now. I found out that when I try to
save an occurrence, the Recipients-property of the AppointmentItem shows 'The Recipients property threw an Exception of type System.COMException (Code -763346939). The exception message is in Dutch ('Fout bij uitvoeren van bewerking') which is a very general message meaning something like 'An error occurred while trying to execute procedure'. The cause of this must be the reason why the items are not saved (or deleted) and thus not added to the exceptions-collection of the main appointment. I'm not sure what this exception is or why it is thrown though.... I will be searching for the solution myself, but any help would very much be appreciated. Hi, I'm developing a .NET-application (C#) which must be able to synchronise the outlook-agenda with the agenda of another application. I'm using the official primary interop assembly for outlook (v11) which works fine. For the synchronisation to work, I must, for example, be able to change the recurrence pattern of an appointment or programmatically add some exceptions to the pattern. I have looked at several examples and it doesn't seem to be very hard: - get the main item/appointment - get it's recurrence pattern - get the occurrence on a specified date - delete this occurrence, or change this occurrence's properties and save it To be more specific, this is some of the code I've written: Code:
MSOutlook.AppointmentItem item = _appointment.GetRecurrencePattern().GetOccurrence(exc.OriginalDate); if (item != null) item.Delete(); .... _appointment.Save(); Here, exc.OriginalDate is the date of an exception-object (a deleted one) from the other application. The code executes fine; while debugging, ''item" gets a valid value, item.Delete() is executed and finally the main appointment is saved. The problem is, and I'm really stuck here, that the Exception-list of the recurrence-pattern doesn't get filled: _appointment.GetRecurrencePattern().Exceptions.Cou nt stays 0! Needless to say, nothing changes in the Outlook-view as well. Deleting or changing occurrences via Outlook's own interface works fine. Am I forgetting some trivial steps when saving or deleting single occurrences of the pattern? If so, the examples I've seen msut be flawed as wel, since I'm almost literally doing the same; the only difference is that most examples are macros of Outlook and are written in VBA, while I'm programming C# and using Outlook's PIA. By the way, I'm testing/debugging on Outlook 2003. |
#3
|
|||
|
|||
Outlook won't create the exception-objects on a recurring appointment
Hmm, seems that this error is yet NOT the cause of my problem. It just
showed the error because Recipients is a protected/secured property which cannot be accessed outside of Outlook. Back to square one.... I think I'm closing to the error now. I found out that when I try to save an occurrence, the Recipients-property of the AppointmentItem shows 'The Recipients property threw an Exception of type System.COMException (Code -763346939). The exception message is in Dutch ('Fout bij uitvoeren van bewerking') which is a very general message meaning something like 'An error occurred while trying to execute procedure'. The cause of this must be the reason why the items are not saved (or deleted) and thus not added to the exceptions-collection of the main appointment. I'm not sure what this exception is or why it is thrown though.... I will be searching for the solution myself, but any help would very much be appreciated. Hi, I'm developing a .NET-application (C#) which must be able to synchronise the outlook-agenda with the agenda of another application. I'm using the official primary interop assembly for outlook (v11) which works fine. For the synchronisation to work, I must, for example, be able to change the recurrence pattern of an appointment or programmatically add some exceptions to the pattern. I have looked at several examples and it doesn't seem to be very hard: - get the main item/appointment - get it's recurrence pattern - get the occurrence on a specified date - delete this occurrence, or change this occurrence's properties and save it To be more specific, this is some of the code I've written: Code:
MSOutlook.AppointmentItem item = _appointment.GetRecurrencePattern().GetOccurrence(exc.OriginalDate); if (item != null) item.Delete(); .... _appointment.Save(); Here, exc.OriginalDate is the date of an exception-object (a deleted one) from the other application. The code executes fine; while debugging, ''item" gets a valid value, item.Delete() is executed and finally the main appointment is saved. The problem is, and I'm really stuck here, that the Exception-list of the recurrence-pattern doesn't get filled: _appointment.GetRecurrencePattern().Exceptions.Cou nt stays 0! Needless to say, nothing changes in the Outlook-view as well. Deleting or changing occurrences via Outlook's own interface works fine. Am I forgetting some trivial steps when saving or deleting single occurrences of the pattern? If so, the examples I've seen msut be flawed as wel, since I'm almost literally doing the same; the only difference is that most examples are macros of Outlook and are written in VBA, while I'm programming C# and using Outlook's PIA. By the way, I'm testing/debugging on Outlook 2003. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Delete an recurrent appointment with a "deleted" exception | alex | Add-ins for Outlook | 0 | April 4th 06 12:41 PM |
deleting a periodic appointment with a "delete exception" | Hans Baumann | Outlook and VBA | 2 | April 3rd 06 09:16 PM |
How do I setup a bimonthly recurring appointment in Outlook 2003? | vynh | Outlook - Calandaring | 1 | March 3rd 06 01:10 PM |
Recurring appointment/events linked to other recurring appointment | uaewhitey | Outlook - Calandaring | 0 | February 2nd 06 07:55 PM |
How to Create Exceptions to Recurring Appointment | Sabrina | Outlook - General Queries | 1 | January 11th 06 02:10 PM |