Results 1 to 11 of 11

Thread: [RESOLVED] How can i get rid of this anoying message ?

  1. #1

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

    Resolved [RESOLVED] How can i get rid of this anoying message ?

    How can get rid of this message:

    ???

    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
    Attached Images Attached Images   
    Last edited by CVMichael; Sep 20th, 2006 at 11:04 AM.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

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

    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...

  4. #4
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    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?

  5. #5

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

    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.

  6. #6

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

    Re: How can i get rid of this anoying message ?

    OK, This is the dialog window using Spy++:


    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:
    1. Private Sub Form_Load()
    2.     'StartEnumWindows
    3.     tmrCheckOutlook.Interval = 150
    4.     tmrCheckOutlook.Enabled = True
    5. End Sub
    6.  
    7. Private Sub tmrCheckOutlook_Timer()
    8.     Dim hWnd As Long, Count As Long
    9.    
    10.     hWnd = FindWindow("#32770", "Microsoft Outlook")
    11.    
    12.     If hWnd <> -1 And hWnd <> 0 Then
    13.         'StartEnumChildWindows hWnd
    14.        
    15.         BringWindowToTop hWnd
    16.         SetForegroundWindow hWnd
    17.        
    18.         Pause 150
    19.        
    20.         SendKeys "{TAB 2}", True
    21.         SendKeys " ", True
    22.         SendKeys "{TAB}", True
    23.         SendKeys "{DOWN 3}", True
    24.         SendKeys "{TAB}", True
    25.         SendKeys "{ENTER}", True   ' < ---- this does not work !!!
    26.         SendKeys " ", True        ' < ---- pressing the space key does not work either...
    27.        
    28.         Debug.Print "tmrCheckOutlook_Timer"
    29.         tmrCheckOutlook.Enabled = False
    30.     End If
    31. End Sub
    32.  
    33. Private Sub Pause(ByVal Delay As Long)
    34.     Dim EndTime As Long
    35.    
    36.     EndTime = GetTickCount + Delay
    37.     Do
    38.         Sleep 10
    39.         DoEvents
    40.     Loop Until GetTickCount >= EndTime
    41. End Sub
    Attached Images Attached Images   

  7. #7

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

    Re: How can i get rid of this anoying message ?

    I got it !!! this works !
    Yeeeyyy
    VB Code:
    1. Private Sub Form_Load()
    2.     tmrCheckOutlook.Interval = 150
    3.     tmrCheckOutlook.Enabled = True
    4. End Sub
    5.  
    6. Private Sub tmrCheckOutlook_Timer()
    7.     Dim hwnd As Long
    8.    
    9.     hwnd = FindWindow("#32770", "Microsoft Outlook")
    10.    
    11.     If hwnd <> -1 And hwnd <> 0 Then
    12.         BringWindowToTop hwnd
    13.         SetForegroundWindow hwnd
    14.        
    15.         Pause 150
    16.        
    17.         SendKeys "{TAB 2}", True  ' Go to the checkbox
    18.         SendKeys " ", True        ' Place the checkmark
    19.         SendKeys "{TAB}", True    ' Go to the drop down box
    20.         SendKeys "{DOWN 3}", True ' Select "10 Minutes"
    21.         SendKeys "{TAB}", True    ' Go to the "Yes" button
    22.        
    23.         ' Press Enter Key
    24.         keybd_event 13, 0, 0, 0
    25.         keybd_event 13, SC_RETURN, KEYEVENTF_KEYUP, 0
    26.        
    27.         tmrCheckOutlook.Enabled = False
    28.     End If
    29. End Sub
    30.  
    31. Private Sub Pause(ByVal Delay As Long)
    32.     Dim EndTime As Long
    33.    
    34.     EndTime = GetTickCount + Delay
    35.     Do
    36.         Sleep 10
    37.         DoEvents
    38.     Loop Until GetTickCount >= EndTime
    39. End Sub

  8. #8
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    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.

  9. #9

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

    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...

  10. #10
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    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?"

    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?

  11. #11

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

    Re: How can i get rid of this anoying message ?

    It works fine with an ActiveX EXE

    Problem solved !

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