![]() |
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
|
|||
|
|||
![]()
Hi
I have developed a C# com addin in VSTO 2005 / Office Professional 2003 and deployed it to a XP pc with Office Standand 2003 (SP2 installed). It all works fine except has this strange behaviour. If you create or open an Outlook Note, you have to click on the X multiple times to close the item. Has anyone experienced this before? Thanks Rowland |
Ads |
#2
|
|||
|
|||
![]()
I don't know if this has anything do with it but deploying a VSTO addin is
only supported for Office 2003 Professional or above. Also, are you doing anything with any Notes objects (IPM.StickyNote)? Notes are brain dead and never should be worked with in code. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Rowland Fong Lip" Rowland Fong wrote in message ... Hi I have developed a C# com addin in VSTO 2005 / Office Professional 2003 and deployed it to a XP pc with Office Standand 2003 (SP2 installed). It all works fine except has this strange behaviour. If you create or open an Outlook Note, you have to click on the X multiple times to close the item. Has anyone experienced this before? Thanks Rowland |
#3
|
|||
|
|||
![]()
Rowland / Ken
I have the exact same scenario as Rowland. Have a C# addin for Outlook (using VSTO 2005 not SE) and using Outlook 2003 SP2. Ken - In my case - there is no programming done for notes. It is more like wiring up the inspectors_NewInspector and inside that i check if item being opened is mail item. If it is then - all the logic but if not then just do nothing. Notes ofcourse falls inside the else block. Recently I opened a case with Microsoft regarding this and am currently working with them on this issue. It seems that this issue is a bug (not related to coding in C#). Also with the above logic - there have been some issues with calender items. Again as mentioned above - I dont program for calender items - so they all fall in else block but it seems that the inspector doesnt release the reference even though i force Garbage collection. Code in the else block (if not mail Item) { Marshal.ReleaseComObject(inspector) inspector = null; GC.WaitForPendingFinalizers(); GC.Collect(); } Rowland - it also seems that depending on the Outlook version you are running - u see a flavour of this issue. My own developement machine has Outlook version 11.8120.8122 SP2 and when i try to click "x" multiple times on the note - it crashes outlook and restarts. A test machine has Outlook version 11.8120.8107 SP2 and there the behavior is that I need to click "x" twice before it closes the note. It doesnt crash Outlook. On speaking to the MS representative - it seems that could be a bug in the product (VSTO or Outlook) but they are still looking into it. Rowland - have u also seen issues for calender items (i am assuming that u are also working with mail items). Regarding notes - i will update this chain if i get a fix and it works......... Thanks |
#4
|
|||
|
|||
![]()
I don't understand.
Why are you releasing the Inspector object? It's local to the scope of NewInspector. I use VSTO 2005 and VSTO 2005 SE and never had to release the Inspector passed in NewInspector. I use Inspector wrapper classes to wrap all Inspectors other than Notes usually, but that's a different story. What exactly is your case with MS about? The usual wisdom regarding programming Notes is don't do it, they're brain dead. That goes back to the Outlook 97 days and hasn't changed at all. A Notes.Inspector object is especially deadly. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "PShah" wrote in message oups.com... Rowland / Ken I have the exact same scenario as Rowland. Have a C# addin for Outlook (using VSTO 2005 not SE) and using Outlook 2003 SP2. Ken - In my case - there is no programming done for notes. It is more like wiring up the inspectors_NewInspector and inside that i check if item being opened is mail item. If it is then - all the logic but if not then just do nothing. Notes ofcourse falls inside the else block. Recently I opened a case with Microsoft regarding this and am currently working with them on this issue. It seems that this issue is a bug (not related to coding in C#). Also with the above logic - there have been some issues with calender items. Again as mentioned above - I dont program for calender items - so they all fall in else block but it seems that the inspector doesnt release the reference even though i force Garbage collection. Code in the else block (if not mail Item) { Marshal.ReleaseComObject(inspector) inspector = null; GC.WaitForPendingFinalizers(); GC.Collect(); } Rowland - it also seems that depending on the Outlook version you are running - u see a flavour of this issue. My own developement machine has Outlook version 11.8120.8122 SP2 and when i try to click "x" multiple times on the note - it crashes outlook and restarts. A test machine has Outlook version 11.8120.8107 SP2 and there the behavior is that I need to click "x" twice before it closes the note. It doesnt crash Outlook. On speaking to the MS representative - it seems that could be a bug in the product (VSTO or Outlook) but they are still looking into it. Rowland - have u also seen issues for calender items (i am assuming that u are also working with mail items). Regarding notes - i will update this chain if i get a fix and it works......... Thanks |
#5
|
|||
|
|||
![]()
Ken
So here is the code in the inspectors_NewInspector method (which is wired up in the ThisApplication_Startup) private void inspectors_NewInspector(Outlook.Inspector inspector) { try { Object objCurrentItem = inspector.CurrentItem; if (objCurrentItem is Outlook.MailItem) { // Enters this if loop if the item is Mail Item and my complete logic is here since my plugin // only has programming done for MailItems } else { Marshal.ReleaseComObject (objCurrentItem); objCurrentItem = null; GC.WaitForPendingFinalizers( ); GC.Collect( ); } } catch (Exception ex) { // Logging to local Event Logs } } So Ken - as you see from above code - everything which is not an MailItem falls into the else block (calender items, notes) etc. I Dont do any programming for notes and totally agree with you that they are brain-dead. But with the above code - any item which is not MailItem falls into the else loop (notes, calender, tasks) and even though I am cleaning up - apparently the notes still holds a reference for inspector and so when I click on "x" - it does close the note. When i click multiple times on the "x" it sometimes closes the note or even crashes Outlook What are your thoughts.... Thanks |
#6
|
|||
|
|||
![]()
I wouldn't release anything at all in NewInspector, it's just not needed and
probably will cause problems. I use late binding to get the Class of the Inspector.CurrentItem using code like this: object item = Inspector.CurrentItem; Type _type; _type = item.GetType(); object[] args = new Object[] { }; Outlook.OlObjectClass _class; _class = (Outlook.OlObjectClass)_type.InvokeMember("Class", BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty, null, item, _args); That lets me check the item.Class. If it's a type I want to handle I do so, if not the NewInspector code does nothing else. It releases nothing. I don't even release item, all that I do is surround the tests for Class in try{}...catch{} blocks. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "PShah" wrote in message oups.com... Ken So here is the code in the inspectors_NewInspector method (which is wired up in the ThisApplication_Startup) private void inspectors_NewInspector(Outlook.Inspector inspector) { try { Object objCurrentItem = inspector.CurrentItem; if (objCurrentItem is Outlook.MailItem) { // Enters this if loop if the item is Mail Item and my complete logic is here since my plugin // only has programming done for MailItems } else { Marshal.ReleaseComObject (objCurrentItem); objCurrentItem = null; GC.WaitForPendingFinalizers( ); GC.Collect( ); } } catch (Exception ex) { // Logging to local Event Logs } } So Ken - as you see from above code - everything which is not an MailItem falls into the else block (calender items, notes) etc. I Dont do any programming for notes and totally agree with you that they are brain-dead. But with the above code - any item which is not MailItem falls into the else loop (notes, calender, tasks) and even though I am cleaning up - apparently the notes still holds a reference for inspector and so when I click on "x" - it does close the note. When i click multiple times on the "x" it sometimes closes the note or even crashes Outlook What are your thoughts.... Thanks |
#7
|
|||
|
|||
![]()
Ken
I will definitely try your suggested code today and see the results. For the notes case though - as I had mentioned above that I have a case open with Microsoft - it has been boiled down to a bug. Below is the exact MS response which I got yesterday: mS Response: I am working with the Dev team regarding the StickyNote close problem. It appears to be an issue introduced by a backport we made in Outlook 2003 for a fix in Outlook 2007 regarding the Item_Close event. The VSTO 2005 AddinLoader for Outlook 2003 is listening for the close event on StickyNotes and canceling the close. I am awaiting some research from the dev team and I will update you when I hear back from them. Thanks |
#8
|
|||
|
|||
![]()
Thanks for following up. I'm not surprised that the fix in Outlook 2003
broke things. The documented result is listed in http://support.microsoft.com/default...b;EN-US;929593 in the section on Some methods no longer work in the Inspector.Close... -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "PS" wrote in message ups.com... Ken I will definitely try your suggested code today and see the results. For the notes case though - as I had mentioned above that I have a case open with Microsoft - it has been boiled down to a bug. Below is the exact MS response which I got yesterday: mS Response: I am working with the Dev team regarding the StickyNote close problem. It appears to be an issue introduced by a backport we made in Outlook 2003 for a fix in Outlook 2007 regarding the Item_Close event. The VSTO 2005 AddinLoader for Outlook 2003 is listening for the close event on StickyNotes and canceling the close. I am awaiting some research from the dev team and I will update you when I hear back from them. Thanks |
#9
|
|||
|
|||
![]()
Sort of the final update which I got from MS:
Lot of discussion going between Outlook team and the VSTO team (after we discovered the issue and pointed it to them) and they are planing to roll the fix in a hotfix which might be relased in the near future. Hopefully that will resolve this issue. |
#10
|
|||
|
|||
![]()
Good to know, thanks.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "PS" wrote in message ps.com... Sort of the final update which I got from MS: Lot of discussion going between Outlook team and the VSTO team (after we discovered the issue and pointed it to them) and they are planing to roll the fix in a hotfix which might be relased in the near future. Hopefully that will resolve this issue. Thanks for following up. I'm not surprised that the fix in Outlook 2003 broke things. The documented result is listed in http://support.microsoft.com/default...b;EN-US;929593 in the section on Some methods no longer work in the Inspector.Close... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Keeping Notes When Rescheduling Time and Date | HeatherL | Outlook - Calandaring | 0 | February 6th 07 05:44 PM |
Registry - CommandBars : Closing Outlook Notes problem | andymarbles | Add-ins for Outlook | 0 | January 18th 07 05:06 PM |
Suggested Appointment time prevents owner from making changes | Brock | Outlook - Calandaring | 1 | October 3rd 06 11:09 PM |
Simple date/time stamp macro for notes area? | c mateland | Outlook and VBA | 2 | August 1st 06 04:55 AM |
Lookout Prevents Outlook 2003 from Loading | LimeyRalph | Outlook - Installation | 1 | April 18th 06 02:16 PM |