Latest Microsoft Office security update issue

Add-in Express™ Support Service
That's what is more important than anything else

Latest Microsoft Office security update issue
 
Esteban Astudillo


Guest


Hi,

This has the double intention of alerting everyone about this issue and see if it can spark ideas for possible work around solutions.

After installing the latest Microsoft Office update (probably the KB924085 patch, although I'm not sure) my add-in started behaving really weird.

In my add-in I need to inspect the MailItem.Body property of a message in the New/Activate Inspector events in Outlook. After the patch is applied if you open a TEXT only message twice, the second time you do it you get a COM exception when you try to access that property.

I can reproduce this at will. In a different machine, same software only that without applying the security update from Microsoft I cannot reproduce the issue.

This sounds pretty serious to me. Am I the only one experiencing this problem?

ADX Support is aware of this, but I thought I should check with other ADX users. Please let everybody know if you can confirm this problem or not.

PS: This does not seem to be an ADX issue, although it could damage the simplicity of use of this tool if confirmed.

Esteban
Posted 25 Jan, 2007 18:39:18 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Esteban.

Thank you very much for your collaboration.

Here is a workaround:
........
private object activeInspector = null;
private const int WM_USER = 0x0400;
private const int WM_MYMESSAGE = WM_USER + 1000;

private void adxOutlookEvents_InspectorActivate(object sender, object inspector, string folderName)
{
activeInspector = inspector;
}

private void adxOutlookEvents_NewInspector(object sender, object inspector, string folderName)
{
this.SendMessage(WM_MYMESSAGE, IntPtr.Zero, IntPtr.Zero);
}

private void AddinModule_OnSendMessage(object sender, AddinExpress.MSO.ADXSendMessageEventArgs e)
{
if (e.Message == WM_MYMESSAGE)
{
Outlook._MailItem oMailItem = null;
if (activeInspector != null)
{
try
{
oMailItem = (activeInspector as Outlook.Inspector).CurrentItem as Outlook._MailItem;
.....
string sBody = oMailItem.Body;
.....
}
finally
{
if (oMailItem != null)
Marshal.ReleaseComObject(oMailItem);
}
}
}
}



P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 26 Jan, 2007 09:22:23 Top
Esteban Astudillo


Guest


Hi Sergey,

Thank you for the work around solution for handling the NewInspector event. I'll keep it in mind if I need to do something like this (I actually use the InspectorActivate event instead when accessing the Body property).

I found out more about this issue (still working on a work around):

- first, I confirmed that this issue is a direct consequence of installing the KB924085 security update from Microsoft (http://www.microsoft.com/downloads/details.aspx?familyid=9E4DD8AE-2564-4176-AC2E-E3760058CB56&displaylang=en)

- I uninstalled this specific security patch and confirmed that accessing the Body property in the NewInspector event for a TEXT only message does not create the COM exception I reported before (see above steps to reproduce).

- the COM exception I get is of type 'System.Runtime.InteropServices.COMException' with message 'Could not complete the operation. One or more parameter values are not valid'. The top of the StackTrace is 'Interop.Outlook._MailItem.get_Body()'

- I use Visual Studio 2005 and in my add-in. I use the PIAs for Outlook 2003.

- I've reproduced this issue using both ADX libraries version 2.8 and 3.2.

So, watch out if in your add-in you need to access the Body property of a MailItem instance in the InspectorActivate event. If one of your users installed the patch and uses TEXT only messages they may experience this problem.

Cheers,
Esteban
Posted 27 Jan, 2007 18:56:20 Top
nfsadx




Posts: 56
Joined: 2006-07-21
Hi Esteban,

I have a problem with KB924085 too but my problem manifests itself such that an Outlook Inspector form fails to appear.

I was wondering whether your workaround may also be applicable to me. So, did you manage to find a workaround that you were happy with? If so, is it possible for you to share your solution please?

For now, I am getting users to uninstall the patch but obviously this is not a long term solution.
Posted 30 Jan, 2007 10:38:46 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi.

You can download the workaround here:
http://www.add-in-express.com/projects/olreadbodyexample.zip
Posted 30 Jan, 2007 11:02:51 Top
Esteban Astudillo


Guest


Hi nfs,

When you said "Outlook Inspector form" do you mean the ADX Outlook Forms (used to be named ADX Extensions for Outlook in version 2.8)?

I'm not using Outlook Forms (as in the ADX component) in my Inspector windows yet. I will start using them soon so if you find a solution to your current problem I'd appreciate if you report it here in the Forums.

In my case the Inspector window shows up normally, but the Messsage Body is empty (I get the COM exception reported above)

I'm sorry I don't have a better answer. The workaround provided by Sergey seems to be working for me (I'm actually testing it right now). Using the SendMessage method/event may help you as well. Try it out.

Good luck

Esteban
Posted 30 Jan, 2007 16:23:00 Top