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
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.
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
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 !
Last edited by CVMichael; Oct 25th, 2006 at 07:42 AM.
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?