Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email via MS Access issue

Status
Not open for further replies.

Shift838

IS-IT--Management
Jan 27, 2003
987
US
I am emailing via MS Access and was wondering if there is a way to automatically select No on the warning that pops up when MS Access is trying to use MS Outlook to send on behalf of you.

Reference:

When you run a program that uses the Microsoft Outlook object model to call the Send method, you receive a warning message.

This warning message tells you that a program is trying to send a message on your behalf and asks if you want to allow the message to be sent. The warning message contains both a Yes and a No button. However, the Yes button is not available until five seconds have passed since the warning message appeared. You can dismiss the warning message immediately if you click No.



 
If you search for
outlook object model guard
in a search engine, you will find lots of stuff.
 
I used the ClickYes program, ran it in suspended mode. then when required used the code below on a forms events, which in turn unsuspended it allowing me to send.

Option Compare Database
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


 
is this the clickyes program?

Option Compare Database
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
 
No, its free download... just google it.

The code was to put in access. I use a form opening to call it.
 
Or, try Googling "Outlook redemption"

Si hoc legere scis, nimis eruditionis habes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top