![]() |
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
|
|||
|
|||
![]()
Greetings,
In the Calendar folder, I add three appointment items as following in sequence: 1. Start time: 9am Subject: Out to breakfast 2. Start time: 10am Subject: Out to meeting 3. Start time: 11am Subject: Out to lunch I create an addin to check for the items in the calendar and integrate it with a voicemail program. The problem I face is when I deleted the first appointment scheduled at 9am, the event at 11am will never be noticed. The code I used to check the items in Calendar folder is as below (I had cut out the code which is unrelated due to lengthy issue): private Outlook.NameSpace myNS; private Outlook.Items myItems; private Outlook.MAPIFolder myFolder; myNS = applicationObject.GetNamespace("MAPI"); myFolder = myNS.GetDefaultFolder(Outlook.OlDefaultFolders.olF olderCalendar); myItems = myFolder.Items; for (intLoopCounter = 1; intLoopCounter = myItems.Count; intLoopCounter++) { // do something here } By the way, after I deleted the first event at 9am, I try to get the start time by using a MessageBox. I get two items listed which is the first at 9am(althought first appointment should be already being deleted) the second events at 10am. The third event at 11am is not listed although the third events at 11am is still listed in the Calendar folder. After that, the first event at 9am which is being deleted from Calendar folder is again deleted from DeletedItem folder. I get an exception as below: unable to cast COM object of type 'System.__ComObject' to interface type Microsoft.Office.Interop.Outlook.AppointmentItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID failed due to the following error: No such interface supported(Exception from HRESULT: 0x80004002(E_NOINTERFACE)) Hope some experts out there can give me some advice in solving this problem. Thanks in advance and have a nice day |
#2
|
|||
|
|||
![]()
Never delete or move items from inside a For Each ... Next type loop. The index counter gets reset each time, so you skip items. Instead use a down-counting loop.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Jynee" Jynee @discussions.microsoft.com wrote in message ... Greetings, In the Calendar folder, I add three appointment items as following in sequence: 1. Start time: 9am Subject: Out to breakfast 2. Start time: 10am Subject: Out to meeting 3. Start time: 11am Subject: Out to lunch I create an addin to check for the items in the calendar and integrate it with a voicemail program. The problem I face is when I deleted the first appointment scheduled at 9am, the event at 11am will never be noticed. The code I used to check the items in Calendar folder is as below (I had cut out the code which is unrelated due to lengthy issue): private Outlook.NameSpace myNS; private Outlook.Items myItems; private Outlook.MAPIFolder myFolder; myNS = applicationObject.GetNamespace("MAPI"); myFolder = myNS.GetDefaultFolder(Outlook.OlDefaultFolders.olF olderCalendar); myItems = myFolder.Items; for (intLoopCounter = 1; intLoopCounter = myItems.Count; intLoopCounter++) { // do something here } By the way, after I deleted the first event at 9am, I try to get the start time by using a MessageBox. I get two items listed which is the first at 9am(althought first appointment should be already being deleted) the second events at 10am. The third event at 11am is not listed although the third events at 11am is still listed in the Calendar folder. After that, the first event at 9am which is being deleted from Calendar folder is again deleted from DeletedItem folder. I get an exception as below: unable to cast COM object of type 'System.__ComObject' to interface type Microsoft.Office.Interop.Outlook.AppointmentItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID failed due to the following error: No such interface supported(Exception from HRESULT: 0x80004002(E_NOINTERFACE)) Hope some experts out there can give me some advice in solving this problem. Thanks in advance and have a nice day |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why are calendar items being placed in my deleted items? | Dan | Outlook - Calandaring | 0 | September 28th 06 06:59 PM |
Outlook shows unread calendar items but all items are marked as re | andy | Outlook - Calandaring | 0 | August 25th 06 07:01 PM |
Problem displaying mail items from within a new thread | Boaz Feldbaum | Add-ins for Outlook | 5 | June 12th 06 09:48 PM |
Does anyone else have a problem with disapearing schedule items? | LRP72 | Outlook - General Queries | 1 | January 20th 06 09:04 PM |
Problem with Sent Items/Redemption | קובץ | Outlook and VBA | 10 | January 12th 06 03:26 PM |