2 Attachment(s)
[RESOLVED] How can i get rid of this anoying message ?
How can get rid of this message:
http://www.vbforums.com/attachment.p...id=51131&stc=1
???
Last time I asked this question, the reply was un-install Service Pack 2, but that's not an option to me.
PS. By a program (in that message) it means MY program... and I need to access Outlook using my program a few times a day.
I also have a VB Macro that runs in Outlook, and I get this message for the macro too :(
Re: How can i get rid of this anoying message ?
SP2 installed a security patch that pops up a notice whenever an external program tries to access anything in Outlook. Your choices - your only choices short of rewriting Outlook or removing SP2 - are don't access Outlook or put up with the message.
If there were some way out everyone would be posting all over the place. It's one of those things everyone wants but no one can have.
Re: How can i get rid of this anoying message ?
Is there a way to remove that security patch ?
I just can't believe that we as programmers, don't have the power to do anything about it...
It's so anoying !
There MUST be a way !
I won't accept NO...
Re: How can i get rid of this anoying message ?
Quote:
Originally Posted by CVMichael
Is there a way to remove that security patch ?
I just can't believe that we as programmers, don't have the power to do anything about it...
It's so anoying !
There MUST be a way !
I won't accept NO...
Since you know that it will pop up when your code runs, set up a timer to look for this particular window. When you find it, simulate mouse commands to click on the checkbox and set the Drop-down box to some decent about of time. While all of this process is running, have a progress box to tell the user to please wait while you are finishing up your process?
As someone else posted, unless you aren't using Outlook or you have access to Outlook's source code to remove this code, you really don't have any options. If you are sending an email, it may be better to just pipe to email directly to the SMTP server, and not try to relay it through Outlook?
Re: How can i get rid of this anoying message ?
Quote:
Originally Posted by Fedhax
If you are sending an email, it may be better to just pipe to email directly to the SMTP server, and not try to relay it through Outlook?
Most of the times I need to reply/[reply to all] to e-mails that are already in Outlook, so I have no choice, I have to use Outlook.
I try to see if I can make it work by finding the windows and SendKeys... Thanks for the idea, it's not very good, but it's better than nothing.
2 Attachment(s)
Re: How can i get rid of this anoying message ?
OK, This is the dialog window using Spy++:
http://www.vbforums.com/attachment.p...id=51163&stc=1
I used this test code to try to select the options, and close the window, but for some reason, it does not press the "Yes" button...
VB Code:
Private Sub Form_Load()
'StartEnumWindows
tmrCheckOutlook.Interval = 150
tmrCheckOutlook.Enabled = True
End Sub
Private Sub tmrCheckOutlook_Timer()
Dim hWnd As Long, Count As Long
hWnd = FindWindow("#32770", "Microsoft Outlook")
If hWnd <> -1 And hWnd <> 0 Then
'StartEnumChildWindows hWnd
BringWindowToTop hWnd
SetForegroundWindow hWnd
Pause 150
SendKeys "{TAB 2}", True
SendKeys " ", True
SendKeys "{TAB}", True
SendKeys "{DOWN 3}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True ' < ---- this does not work !!!
SendKeys " ", True ' < ---- pressing the space key does not work either...
Debug.Print "tmrCheckOutlook_Timer"
tmrCheckOutlook.Enabled = False
End If
End Sub
Private Sub Pause(ByVal Delay As Long)
Dim EndTime As Long
EndTime = GetTickCount + Delay
Do
Sleep 10
DoEvents
Loop Until GetTickCount >= EndTime
End Sub
Re: How can i get rid of this anoying message ?
I got it !!! this works !
Yeeeyyy :)
VB Code:
Private Sub Form_Load()
tmrCheckOutlook.Interval = 150
tmrCheckOutlook.Enabled = True
End Sub
Private Sub tmrCheckOutlook_Timer()
Dim hwnd As Long
hwnd = FindWindow("#32770", "Microsoft Outlook")
If hwnd <> -1 And hwnd <> 0 Then
BringWindowToTop hwnd
SetForegroundWindow hwnd
Pause 150
SendKeys "{TAB 2}", True ' Go to the checkbox
SendKeys " ", True ' Place the checkmark
SendKeys "{TAB}", True ' Go to the drop down box
SendKeys "{DOWN 3}", True ' Select "10 Minutes"
SendKeys "{TAB}", True ' Go to the "Yes" button
' Press Enter Key
keybd_event 13, 0, 0, 0
keybd_event 13, SC_RETURN, KEYEVENTF_KEYUP, 0
tmrCheckOutlook.Enabled = False
End If
End Sub
Private Sub Pause(ByVal Delay As Long)
Dim EndTime As Long
EndTime = GetTickCount + Delay
Do
Sleep 10
DoEvents
Loop Until GetTickCount >= EndTime
End Sub
Re: How can i get rid of this anoying message ?
Quote:
Originally Posted by CVMichael
I got it !!! this works !
Yeeeyyy :)
Congrats. As I said, the only option you had was to simulate the end user's input and appease Outlook. It is kinda kludgy, but you gotta do what a VB programmer has gotta do. :cool:
Re: How can i get rid of this anoying message ?
Here's something twisted !
If I put that code in the same program that accesses the Outlook, the code won't run because Outlook freezes the program until the security window closes...
So, probably have to put the code into an ActiveX EXE or a complectly separate program...
Re: How can i get rid of this anoying message ?
Quote:
Originally Posted by CVMichael
Here's something twisted !
If I put that code in the same program that accesses the Outlook, the code won't run because Outlook freezes the program until the security window closes...
So, probably have to put the code into an ActiveX EXE or a complectly separate program...
"Showing windows using vbModal is bad, m'kay?" :rolleyes:
After fighting my own battles with vbModal forms, I can sympathize greatly with your plight. I guess you are right that an ActiveX.EXE is your best way to go: Start it up, get Outlook to slow you down, have ActiveX.EXE kill the dialog window, and end the ActiveX.EXE--unless you just want it trolling for a window that may not be there much of the time?
Re: How can i get rid of this anoying message ?
It works fine with an ActiveX EXE
Problem solved !