Results 1 to 8 of 8

Thread: VB6 - Auto accept Outlook Security Message

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    VB6 - Auto accept Outlook Security Message

    Did you ever get this anoying message when accessing Outlook from your program ?


    Recently I had this problem, I asked for help, and got the anser myself here:
    [RESOLVED] How can i get rid of this anoying message ?

    Well the solution is simple, there are only a 2 main steps:
    Find the Outlook window
    When found, SendKeys to select the options, and click the "Yes" button.

    The problem is that Outlook freezes your program while the window is showing, so the anser is to put all the code that closes the window, either in another application, or an ActiveX EXE (since it is in another thread).

    You will find attached 2 projects, one is the ActiveX EXE, and the other is a regular application that is using Outlook.

    First start the ActiveX EXE (KillOutlookMSG.vbp), and then start the UseOutlook.vbp.
    Make sure the references are still there !
    UseOutlook.vbp has a reference to Outlook, and another to the ActiveX EXE KillOutlookMSG.vbp
    Attached Files Attached Files

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: VB6 - Auto accept Outlook Security Message

    Yes, that is the solution but using a timer and sendkeys is still not 100% reliable but does work for the most part. I did something similar with an out of process thread but used a complete api solution for more reliability. Hooking the dialog creation instead of polling a timer for a reduced resource effect.

    My freeware Outlook DismissMe™ code does this too. . Only problem was that "Click Yes" is so dominant that I never got mine to take off. I wanted to charge a nominal fee for it but changed it to freeware after I see the lack of response due to Click Yes being free.

    In Outlook 2007 the security rules have been dramatically relaxed. If the system is found to be running an antivirus software. Microsoft said they are loosening it up and letting the system rely upon the AV for most of its protection.

    Oh and dont forget that different security issues have a different security dialog box.

    Cheers on another great Code Bank entry!
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: VB6 - Auto accept Outlook Security Message

    Quote Originally Posted by RobDog888
    ... Cheers on another great Code Bank entry!
    Thank you

    Quote Originally Posted by RobDog888
    ... Hooking the dialog creation instead of polling a timer for a reduced resource effect.
    I've never seen it done, do you have an example ?

    Also... I don't mind if you post your solution(s) too (or links to them).

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: VB6 - Auto accept Outlook Security Message

    Actually its on my server which the HD or AD is messed up. I already have another hd and am installing a new instance of 2003 server so I can try to gain access to my data. I think I should be able to get it soon.

    When I get my site back up I can PM you the link as I cant advertise my site on vbf

    A system wide hook can be setup with SetWindowHookEx - http://msdn.microsoft.com/library/de...ns/cbtproc.asp to catch the window being created before it even gets displayed.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Lively Member
    Join Date
    Feb 2005
    Posts
    115

    Re: VB6 - Auto accept Outlook Security Message

    For some reason it doesn't do anything on my PC ? ....

    Using your code, that message is still there....

    WithEvents CheckOutlook As cls...
    gives and error: UserDefined type not defnied
    Last edited by rookie7799; Oct 25th, 2006 at 01:11 AM.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: VB6 - Auto accept Outlook Security Message

    Quote Originally Posted by rookie7799
    For some reason it doesn't do anything on my PC ? ....

    Using your code, that message is still there....

    WithEvents CheckOutlook As cls...
    gives and error: UserDefined type not defnied
    As I was saying in the first post, make sure the references are still correct.

    Make sure the KillOutlookMSG is compiled first ! (or Run it in the IDE)

    Then if you go to "Project" menu, click on "References", you should NOT see any "MISSING" in front of the reference.
    So, if it looks like this:

    Then uncheck the MISSING one, and click "OK"
    Go back to the references window, and scroll down to "KillOutlookMSG", and make sure it is checkmarked !
    Attached Images Attached Images   
    Last edited by CVMichael; Oct 25th, 2006 at 07:42 AM.

  7. #7
    New Member
    Join Date
    Mar 2004
    Location
    USA
    Posts
    2

    Re: VB6 - Auto accept Outlook Security Message

    Using CVMichael's ActiveX works, but the ActiveX remains loaded (shows up in Task Manager) even after closing the calling application. This is even though I implemented the code in Query Unload of the calling form:
    -------------------------------------
    If Not (CheckOutlook Is Nothing) Then
    CheckOutlook.Enabled = False
    DoEvents
    Set CheckOutlook = Nothing
    End If
    -------------------------------------

    Any idea on how I can make sure the ActiveX gets unloaded from memory when the main app closes?

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: VB6 - Auto accept Outlook Security Message

    An ActiveX is supposed to be loaded at all times... I don't think there is a way to properly close it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width