MS Office Forum / Outlook / Programming Add-Ins / May 2008
Outlook Meeting Request Bug
|
|
Thread rating:  |
Tim Pulley - 25 Apr 2008 18:37 GMT I've found what I believe is a bug in Outlook. I can demonstrate the problem with the following code. It's a small add-in that hooks an event on the Application object. The problem only happens when the add-in is installed.
I've don't see anything wrong with this code. If anyone sees a problem please let me know.
TIA, Tim
public partial class ThisAddIn { private void ThisAddIn_Startup( object sender, System.EventArgs e ) { try { m_application = Globals.ThisAddIn.Application;
( (Outlook.ApplicationEvents_11_Event) m_application ).OptionsPagesAdd += new Outlook.ApplicationEvents_11_OptionsPagesAddEventHandler( onEvent_OptionsPagesAdd );
} catch( Exception X ) { } }
private void ThisAddIn_Shutdown( object sender, System.EventArgs e ) { try { ( (Outlook.ApplicationEvents_11_Event) m_application ).OptionsPagesAdd -= new Outlook.ApplicationEvents_11_OptionsPagesAddEventHandler( onEvent_OptionsPagesAdd );
m_application = null; } catch( Exception X ) { } finally { } }
private void onEvent_OptionsPagesAdd( Outlook.PropertyPages PropertyPages ) { return; }
//
Outlook.Application m_application;
#region VSTO generated code
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InternalStartup( ) { this.Startup += new System.EventHandler( ThisAddIn_Startup ); this.Shutdown += new System.EventHandler( ThisAddIn_Shutdown ); }
#endregion }
Dmitry Streblechenko - 25 Apr 2008 19:39 GMT And the bug is?
 Signature Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool -
> I've found what I believe is a bug in Outlook. I can demonstrate the > problem [quoted text clipped - 70 lines] > #endregion > } Tim Pulley - 25 Apr 2008 20:04 GMT Hooking an event on the Outlook Application object creates a problem with appointments generated from meeting requests. If, after sending the meeting request, I open and modify the appointment's body and then save the appointment, Outlook displays a message box stating that the meeting's attendee list has changed. [Here's my favorite part] When I close Outlook it sends an updated meeting request even though I closed the appointment without saving the changes. The problem only happens in the Outlook session that generated the appointment. If I close and reopen Outlook I can change the appointment's body and save it without any problem.
I've tried six different events and they all produce the problem. The add-in was created using VSTO 2005 SE and I'm running a fully patched version of Outlook 2007. But it also happens with RTM version of Outlook 2007.
> And the bug is? > [quoted text clipped - 74 lines] >> #endregion >> } Dmitry Streblechenko - 25 Apr 2008 21:35 GMT I have never seen that happen. Are you saying that if you comment out the following line the problem immediately goes away?
( (Outlook.ApplicationEvents_11_Event) m_application ).OptionsPagesAdd += new Outlook.ApplicationEvents_11_OptionsPagesAddEventHandler( onEvent_OptionsPagesAdd );
 Signature Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool -
> Hooking an event on the Outlook Application object creates a problem with > appointments generated from meeting requests. If, after sending the [quoted text clipped - 89 lines] >>> #endregion >>> } Tim Pulley - 30 Apr 2008 01:16 GMT Dmitry,
Yes, that's exactly what I'm saying. Comment out the line of code that hooks the event and the problem disappears. I can repro the problem on multiple systems.
When you say "I have never seen this happen" do you mean that you've tested this and you can't reproduce the problem?
> I have never seen that happen. > Are you saying that if you comment out the following line the problem [quoted text clipped - 98 lines] > >>> #endregion > >>> } Dmitry Streblechenko - 30 Apr 2008 17:57 GMT I mean I use Application events all over the place and I have never experienced this.I do not use VSTO or ,.Net though. Try an experiment: disable your add-in and install OutlookSpy. Start Outlook and click on teh Application button on teh OutlookSpy toolbar, go to the Events tab. Leave the window open. Can you reproduce the appointment problem while that window is still open (it hooks up the Application events)?
 Signature Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool -
> Dmitry, > [quoted text clipped - 119 lines] >> >>> #endregion >> >>> } Ken Slovak - [MVP - Outlook] - 30 Apr 2008 18:44 GMT FWIW, I do use VSTO and shared managed code addins and have also never seen anything like that. The only times I've seen something similar was when I was testing earlier versions of the Apple ITunes addin before it was fixed, possibly some misbehaving addin is also running.
 Signature Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm
>I mean I use Application events all over the place and I have never >experienced this.I do not use VSTO or ,.Net though. [quoted text clipped - 3 lines] > appointment problem while that window is still open (it hooks up the > Application events)? Tim Pulley - 01 May 2008 20:21 GMT Ken and Dimetry,
I probably should have titled this Outlook / VSTO 2005 SE Meeting Request bug.
The problem is caused by the add-in. It is the only add-in / extension loaded. I've disabled all add-ins via the Trust Center. I've double checked the LoadBehavior registry value for each add-in (under both the HKLM and HKCU registry keys). I also checked the Exchange Extension registry key.
I've tested using Outlook 2007 RTM thru SP1 on 5 different systems and it's consistently reproducible. It happens when the code is compiled on my development VMs, our build system or a non-VM development workstation. It happens on my Development VMs (XP-SP2, VS 2005 SP1, VSTO 2005 SE and Office 2007 [RTM and SP1]) and our test VMs (XP-SP2, VSTO 2005 SE runtime and Office 2007 SP1).
I've modified the demo code so that the application event can be hooked / unhooked from the explorer's menu and the problem still happens. If you want to try this out let me know and I'll send you the code for the add-in.
So is there anything wrong with the code?
> FWIW, I do use VSTO and shared managed code addins and have also never > seen anything like that. The only times I've seen something similar was [quoted text clipped - 8 lines] >> appointment problem while that window is still open (it hooks up the >> Application events)? Ken Slovak - [MVP - Outlook] - 01 May 2008 23:58 GMT See if the same thing happens with one of my VSTO addin templates. They're posted at http://www.slovaktech.com/outlook_2007_templates.htm.
They were developed on VS 2005 SP1, WinXP SP2, Outlook 12 RTM, VSTO 2005SE.
Also, make sure you are using the revised VSTO runtime.
I'd take a look at the onEvent_OptionsPagesAdd() event handler and compare it to mine. I'm not sure Outlook would take to the way you're doing it.
 Signature Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm
> Ken and Dimetry, > [quoted text clipped - 20 lines] > > So is there anything wrong with the code? Tim Pulley - 02 May 2008 18:47 GMT Ken,
The updated runtime is installed. All the VMs were created specifically for this project so they've never had VSTO 2005 (1st edition) installed.
I've looked at your template and my event handler and I don't know why you say that Outlook wouldn't like my event handler. The call to hook the event looks right. The event handler's signature is correct. It doesn't do anything, which is OK. What do you think is wrong?
I tested this with following five application events
ContextMenuClose ItemContextMenuDisplay OptionsPagesAdd ViewContextMenuDisplay ItemSend
and they all produced the problem.
With the exception of the ItemSend, I choose these events because they wouldn't fire. I wanted to exclude interaction between my event handlers and Outlook.
To test this I open Outlook, go to the calendar, create a meeting request using the keyboard shortcut and send it. I open the appointment, type in the body and then click the save button at the top of the form.
Thanks for taking the time to help.
Tim
> See if the same thing happens with one of my VSTO addin templates. They're > posted at http://www.slovaktech.com/outlook_2007_templates.htm. [quoted text clipped - 6 lines] > I'd take a look at the onEvent_OptionsPagesAdd() event handler and compare > it to mine. I'm not sure Outlook would take to the way you're doing it. Tim Pulley - 06 May 2008 18:04 GMT FYI...I just got off the phone w/MS tech support and they can repro the the problem.
Tim
> See if the same thing happens with one of my VSTO addin templates. They're > posted at http://www.slovaktech.com/outlook_2007_templates.htm. [quoted text clipped - 30 lines] > > > > So is there anything wrong with the code? Ken Slovak - [MVP - Outlook] - 07 May 2008 00:06 GMT Interesting. I'll see if I can repro it here, in both managed and unmanaged code. I'm curious where the bug is, in Outlook or the PIA.
Have you tested this at all on Outlook 2003, or only on 2007?
 Signature Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm
> FYI...I just got off the phone w/MS tech support and they can repro the > the > problem. > > Tim Tim Pulley - 07 May 2008 20:58 GMT Ken,
It's very easy to repro. Just hook an application event. I have several small demo add-ins if you're interested.
We're re-writting our app in .Net for Outlook & Exchange 2007 so I've only tested with Outlook '07. I haven't had time to go back and test w/ Outlook '03.
It appears to be a problem in the PIA. I took Dimtry's suggestion and used OutlookSpy to hook Application events and I couldn't repro the problem.
I heard from the MS tech this afternoon and the work-around is to call Marshall.ReleaseComObject on the Item in the ItemSend event. It appears to work. Setting the Item to null doesn't.
Tim
> Interesting. I'll see if I can repro it here, in both managed and unmanaged > code. I'm curious where the bug is, in Outlook or the PIA. [quoted text clipped - 6 lines] > > > > Tim Ken Slovak - [MVP - Outlook] - 07 May 2008 21:24 GMT Thanks. Unfortunately completely releasing the object in Send isn't a real good solution in many cases.
For one example, you do some item processing in Send and then have to start up a timer object to allow closing the Inspector using code, something that will cause an exception if you do it in the Send event. So you set a timer for a short interval at the end of Send and when the timer fires you call Inspector.Close().
Calling Marshal.ReleaseComObject() on the item in Send would prevent that code from working at all.
I'll see if I can verify your bug here and if so I'll file it with the product group. That way we can be sure that they're aware of it. A lot of times if first line support files something it gets lost in the shuffle. It's only if you get to the higher-ups on the support front that their bug reports are paid attention to.
Why don't you email me a couple of your small samples please, use my posting address, I'll get them. Then I can review them and see what's going on. If you don't mind giving me the name of the PSS engineer you worked with and the bug case # too, that would help when I get back to the product group.
 Signature Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm
> Ken, > [quoted text clipped - 13 lines] > > Tim Tim Pulley - 09 May 2008 14:48 GMT Ken,
I've sent you an email with the info you requested. Let me know if you don't get it.
Thanks, Tim
> Thanks. Unfortunately completely releasing the object in Send isn't a real > good solution in many cases. [quoted text clipped - 36 lines] > > > > Tim
|
|
|