Jump to content
Sign in to follow this  
water

OutlookEX UDF: Anyone using _OL_Warnings to suppress Outlook security warnings?

_OL_Warnings from OutlookEX UDF  

8 members have voted

  1. 1. Do you use _OL_Warnings?

  2. 2. Would you spend a few minutes to test the AdLib version when available?



Recommended Posts

water

Does anyone use _OL_Warnings.au3 to suppress Outlook security warnings?

At the moment it is a separate exe (for historical reasons). I would like to change this and use AdLibRegister so no second script is needed.

If there are enough people using _OL_Warnings I'm going to rewrite this code.

But I need a few users to test because here I don't get the security warnings.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
CaoD

Would be more than happy to do so. Could not use the _InetSMTPmail at work... tried the OutlookEX and it works as a charm but getting those "annoying" warnings... I was already thinking of what do to get the script itself to handle them but apparently somebody is already working on something much better.

Following Topic :-)

Share this post


Link to post
Share on other sites
water

You know that there is already a way to automatically get rid of this warnings? Set parameter $sWarningProgram to the program that waits for a warning and clicks it away. There is an example _OL_Warnings.au3 available. Should work for English systems. Just compile and set the parameter for _OL_Open.

Depending on the language and the Outlook version modifications might be necessary.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
CaoD

You know that there is already a way to automatically get rid of this warnings? Set parameter $sWarningProgram to the program that waits for a warning and clicks it away. There is an example _OL_Warnings.au3 available. Should work for English systems. Just compile and set the parameter for _OL_Open.

Depending on the language and the Outlook version modifications might be necessary.

 

Thanks for pointing it out, I was actually just reading that a few moments ago. Luckily, at work, my system is in English so it should be ok. For the moment having to click the window isn't a big deal as I'm behind the screen monitoring my script and the email function is being called in only at the end in order to send the mail + attachments reporting script results.

By the way, congrats on the job done on the function! Amazing work!

Share this post


Link to post
Share on other sites
water

Glad to hear you like the UDF :D


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
CaoD

Tested _OL_Warnings.au3 today at work and it works like a charm. It would be really nice to have it as a built in function but it looks like not a lot of people are using it :(

Share this post


Link to post
Share on other sites
water

This function isn't needed very much nowadays. As soon as you have an up-to-date AV program installed Outlook doesn't display this security warnings.

_OL_Warnings is a separate exe because often some customization is needed. So I think it will stay as it is for the moment.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
CaoD

This function isn't needed very much nowadays. As soon as you have an up-to-date AV program installed Outlook doesn't display this security warnings.

_OL_Warnings is a separate exe because often some customization is needed. So I think it will stay as it is for the moment.

 

Unfortunately, where I'm currently running the scripts - workplace - I have zero control over what I can install / update on the machine so I'm really happy that _OL_Warnings was included in the UDF :thumbsup:

Furthemore, it helped me discover the "ToolTip" command which I might be using in the future now that I know about it.

Share this post


Link to post
Share on other sites
water

That was one of the great ideas by the author of the original Outlook UDF - wooltown.

We have AV software installed so _OL_Warnings is one of the features of the UDF I can't test. I'm glad it works for you.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

Id happily test this for you, its certainly something id like!

Share this post


Link to post
Share on other sites
water

quinnj09,

thanks for the offer!

As I haven't coded the AdLibRegister feature yet AND the demand is quite low AND we have a working alternative I think I will invest my time in enhancing the UDF with features of Outlook 2010 and 2013.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
orbs

hello all,

first, @water: i know you probably her this a lot, but here's one more: THAT IS ONE AWESOME UDF!

i had an issue with _OL_Warnings - the language support is not "out of the box", and i need it running for at-least 2 languages, without knowing which it is being currently used. so i took the concept of _OL_Warnings and rewrote it using a different method to detect the warning window: instead of checking for title and text, i took the following route:

1) before anything happens: take a list of all open windows related to Outlook (i.e. the Outlook application and any open message)

2) in the main loop: for every pass, take again the list; compare it to the saved list taken in step (1); if there is a new window, it's probably the warning; try to acknowledge it.

so this is not language-dependent.

i'm sure there is plenty to improve on this, but here's what i've got working for me:

#NoTrayIcon
#Include <Array.au3>
If $CmdLine[0] = 0 Then Exit 1
$iOL_ProcessID = $CmdLine[1]
If Not ProcessExists($iOL_ProcessID) Then Exit 2
If $CmdLine[0] > 1 Then $iOL_WinCheckTime  = $CmdLine[2]
If $CmdLine[0] > 2 Then $iOL_CtrlCheckTime = $CmdLine[3]
If $CmdLine[0] < 2 Then $iOL_WinCheckTime  = 10
If $CmdLine[0] < 3 Then $iOL_CtrlCheckTime = 10
$WinList_base=GetWinList('Outlook')
While True
    Sleep($iOL_WinCheckTime)
    If Not ProcessExists($iOL_ProcessID) Then Exit
    $WinList_curr=GetWinList('Outlook')
    If $WinList_curr[0]=$WinList_base[0] Then ContinueLoop
    For $i=1 To $WinList_curr[0]
        $TargetTitle=$WinList_curr[$i]
        If _ArraySearch($WinList_base,$TargetTitle)=-1 Then
            WinActivate($TargetTitle)
            ControlCommand($TargetTitle,'','Button3','Check')
            Sleep($iOL_CtrlCheckTime)
            ControlFocus($TargetTitle,'','[CLASS:Button; INSTANCE:4]')
            Send("{SPACE}")
            Sleep($iOL_CtrlCheckTime)
        EndIf
    Next
WEnd

Func GetWinList($sPartOfTitle)
    Dim $local_WinList_final[1]=[0]
    Local $i
    Local $iNext=2
    $local_WinList_full=WinList()
    For $i=1 To $local_WinList_full[0][0]
        If StringInStr($local_WinList_full[$i][0],$sPartOfTitle) And IsVisible($local_WinList_full[$i][1]) Then
            ReDim $local_WinList_final[$iNext]
            $local_WinList_final[$iNext-1]=$local_WinList_full[$i][0]
            $local_WinList_final[0]=$iNext-1
            $iNext+=1
        EndIf
    Next
    Return $local_WinList_final
EndFunc

Func IsVisible($handle)
  If BitAnd(WinGetState($handle),2) Then
    Return True
  Else
    Return False
  EndIf
EndFunc

again, thanks for your amazing work.

Or

Share this post


Link to post
Share on other sites
water

orbs,

thank you very much for the positive feedback! I'm glad you like the UDF!

_OL_Warnings intentional is not ready to run for every Outlook version in any language. But to make it easier to adopt the language code is passed.

It's great to now have a language independant version of the function.

But as you have seen by the large amount of replies I got the Outlooks warnings don't seem to be a big problem nowadays. Most of the users have moved to Outlook 2077 or later and have current AV scanners installed.

Thanks for posting your code. That's a good reference for future users!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
jdelaney

@Orbs If there is an open popup, this will grab it much easier:

$GW_ENABLEDPOPUP= 6
$hCurrentWindow = _WinAPI_GetWindow($hOwner, $GW_ENABLEDPOPUP)

if it's a valid handle (IE not 0x0000000), you can use wingettitle

not sure of your exact situation...but just to demonstrate, open an email, and send with no data (get a popup)...then attach to the email:

#include <WinAPI.au3>
$hwnd = WinGetHandle("Untitled")
$hwnd2 = _WinAPI_GetWindow($hwnd, 6)
ConsoleWrite($hwnd2 & @CRLF)
ConsoleWrite(WinGetTitle($hwnd2) & @CRLF)
ConsoleWrite(WinGetText($hwnd2) & @CRLF)

output:

0x005913E4
Microsoft Outlook
OK
There must be at least one name or contact group in the To, Cc, or Bcc box.
 

also, use controlclick rather than send :)

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
orbs

@water: well, your humble servant is working in a place where Office 2003 is the ruling environment. and that's the good news. its a very big organization, and very, very conservative. so don't dump us out just yet...

@jdelaney: thanks, i will try your suggestion. the helpfile is kind of lacking when it comes to _WinAPI stuff, but i assume the return value would be a handle to a popup window of the specified owner window? if so, what would happen in case several pop-ups exist for the owner window?

Share this post


Link to post
Share on other sites
jdelaney

use this, if you havent downloaded the winapi udf (it's in the sample scripts forum)

$hwnd = WinGetHandle("Untitled")
ConsoleWrite($hwnd & @CRLF)
$h = DllCall("user32.dll", "HWND", "GetWindow", "HWND", $hwnd, "UINT", 6)
;~ _ArrayDisplay($h)
ConsoleWrite("parent:" & $h[1] & @CRLF)
ConsoleWrite("popup:" & $h[0] & @CRLF)

again, if there is no popup, you will get something like this:

0x007C0B38
parent:0x007C0B38
popup:0x00000000

with popup, something like this:

0x007C0B38
parent:0x007C0B38
popup:0x002314B8

edit: sorry that this is off topic, water :)

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
orbs

thanks jdelaney for the explanation, i'l give it a try.

Share this post


Link to post
Share on other sites
water

@water: well, your humble servant is working in a place where Office 2003 is the ruling environment. and that's the good news. its a very big organization, and very, very conservative. so don't dump us out just yet...

I hope to support Outlook 2003 as long as there are users of this version out there.

Unfortunately new functions will only be available for later versions :(


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×