NetOffice.OutlookSecurity.Supress.Enabled not working as intended

Mar 4, 2013 at 10:46 AM
Edited Mar 4, 2013 at 10:46 AM
I've added the line

NetOffice.OutlookSecurity.Supress.Enabled = true

into my code on several places, but our users still get the security warning from Outlook (using a RDP Session on a Windows 2008 R2 terminal server).

I recognized, that it looks like some commands are resetting the .Enabled = true to false:

NetOffice.OutlookSecurity.Supress.Enabled = True
cOutlook = New Outlook.Application ---> reset to false
NetOffice.OutlookSecurity.Supress.Enabled = True
cOutlookNameSpace = cOutlook.GetNamespace("MAPI") --> reset to false
NetOffice.OutlookSecurity.Supress.Enabled = True
cOutlookMailItem = cOutlookNameSpace.OpenSharedItem(strFileName) --> reset to false

Looks like I made a mistake understanding how this command is working.

I'm using VB 2010.

Any help would be appreciated.
Developer
Mar 4, 2013 at 3:34 PM
What Outlook version do you work with?
Mar 5, 2013 at 8:05 AM
Edited Mar 5, 2013 at 8:25 AM
Outlook 2007

And I've done some investigations and found the following behaviour:

If Outlook is not startet or Oulook is in the background or minimized, the Outlook icon in the start bar starts to blink when you access Outlook from the VB application the first time and the VB application is locked. If you bring Outlook to the front, the window with the security alert is shown very shortly and disappears nearly immediatly. Then everything works well.

The problem is that sometimes you can't bring Outlook to the front (I don't know why), and then the VB application is locked and the only way to solve this is to terminate the process.
Mar 8, 2013 at 11:43 AM
I have to say that I'm a little bit upset with the NetOffice.OutlookSecurity.Supress.Enabled function.

It looks like this property isn't changing anything in the Outlook security settings, it's just pressing buttons in the security popup of Outlook (or using the bad bad "sendkey" command)

I recognized this because if I enable the Supress property, all popup dialog windows of outlook starts to show a strange behaviour. You can try this by opening, let's say, an appointment, the open the drop down "Categorize" and select "all categories". You will see that the "Add New Category" dialog pops up and starts blinking like someone is hitting a wrong button. You can also open the "all categories" and then set the Supress.Enable property to true. The dialog "Add New Category" will magically appear and start to blink. This happens also if you try to add a folder in your personal folders.

Together with the problems I pointed in my previous post this function is causing more troubles than it solves.

Any comments?
Developer
Mar 8, 2013 at 2:27 PM
Edited Mar 8, 2013 at 3:11 PM
According to the NetOffice source code it really clicks controls in security dialog.
...
                foreach (SecurityDialog item in _listDialogs)
                {
                    List<IntPtr> childWindows = User32.GetChildWindows(item.Handle);
                    if (!IncludeOneComboBox(childWindows))
                        continue;

                    IntPtr checkBox = GetCheckBox(childWindows, item.Handle);
                    string checkBoxText = User32.GetWindowText(checkBox);
                    if ((IntPtr.Zero != checkBox) && (!string.IsNullOrEmpty(checkBoxText)))
                        PostSendClick(checkBox);

                    IntPtr leftButton = GetLeftButton(childWindows, item.Handle);
                    string buttonText = User32.GetWindowText(leftButton);
                    if ((IntPtr.Zero != leftButton) && (!string.IsNullOrEmpty(buttonText)))
                        PostSendClick(leftButton);
...
NetOffice Outlook Security wiki tells the same:
Along with the introduction of this security feature in 2002, a tool named "ClickYes" gained popularity among Outlook developers. This tool runs in the background and automatically confirms the security dialog. The Outlook Security Component works in principle just like "ClickYes" and confirms the dialog automatically.
Mar 11, 2013 at 2:24 PM
If it would only click yes in the security dialog it would be fine.
But it tries to click yes in every dialog window.
And it doesn't click yes, if Outlook is in the background.
Developer
Mar 11, 2013 at 4:13 PM
So it's time to add a bug to an issue tracker?
Mar 13, 2013 at 9:23 AM
Edited Mar 13, 2013 at 9:24 AM
artnib wrote:
So it's time to add a bug to an issue tracker?
done, please vote ;)