vb123.com.au
One of the more annoying things to cope with when programming for Microsoft Outlook is the security messages that pop up to stop the boring email spammers. The ones that you may be familiar with are
"A program is trying to automatically trying to send e-mail messages on your behalf. Do you want to allow this?"
or "A program is trying to automatically access email address that you have stored in Outlook. Do you want to allow this?"
There are a few programming options on the market to solve
this but none are quite as easy to implement as this program which initially doesn't require any
programming and doesn't require any cash either.
http://www.contextmagic.com/express-clickyes/
Key features of this program is that it doesn't need to be turned on when it
starts, it can be turned on in vba code if necessary and it only consumes a
small amount of memory.
It sits in your task bar and looks like this
![]()
Security Note: Turning off Outlook
warning messages leaves you vulnerable to the very things it is trying to
protect against. ie. Exposing yourself to a script virus which can run at the
same time as the warnings are off. So if you are happy with the solution, use
VBA code to ensure that Click Yes is suspended most of the time.
Comment from a
The Code that will start and suspend this program looks as follows. In this case the program is resumed when the form is opened and disabled when the form is closed.
Option Compare Database
Option Explicit
' Declare Windows' API functions
Private Declare Function RegisterWindowMessage _
Lib "user32" Alias "RegisterWindowMessageA" _
(ByVal lpString As String) As Long
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As Any, _
ByVal lpWindowName As Any) As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Sub Form_Load()
Dim wnd As Long
Dim uClickYes As Long
Dim Res As Long
' Register a message to send
uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
' Find ClickYes Window by classname
wnd = FindWindow("EXCLICKYES_WND", 0&)
' Send the message to Resume ClickYes
Res = SendMessage(wnd, uClickYes, 1, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim wnd As Long
Dim uClickYes As Long
Dim Res As Long
' Register a message to send
uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
' Find ClickYes Window by classname
wnd = FindWindow("EXCLICKYES_WND", 0&)
' Send the message to Suspend ClickYes
Res = SendMessage(wnd, uClickYes, 0, 0)
End Sub
Sample database is suited to all versions of Access,
The download file contains the code above in a simple form that resumes ClickYes
when the database opens and suspends it when the database closes.
If you do NOT own "The Toolbox", Click
here to find out how to purchase The Toolbox.
Garry Robinson runs GR-FX Pty Limited, a company based in Sydney,
Australia. If you want to keep up to date with the his latest postings on Access
Issues, visit his companies popular web site at http://www.vb123.com/ or sign
up for his Access email newsletter by
Taking Outlook and XML to Task in MS Access
Processing E-Mail
Orders using Outlook and Access
Personalised Email from Access and
Word
Click on the following button
to jump to the next page in the document loop.
Get Good Help Here
If you need help with a database or
Office programming,
our Professionals could be the answer because we have worked on many
similar solutions
Frontpage Conversions
We have converted vb123.com to Expression Web,
contact us if we can help you move to the latest Microsoft web tool.
About The Editor ~ Contact Us
Garry Robinson writes for a number
of popular computer magazines, is now a book author and has worked on
100+ Access databases. He is based in Sydney, Australia