The below code is code I got off of the internet for invoking clickyes when sending emails from access.
I created a module named modclickyes. I inserted the 2nd bit of code on Form Load. The 3rd bit of code I put on Form Unload.
When I debug I get the following error:
Compile Error:
Sub or Function not defined
uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
I created a module named modclickyes. I inserted the 2nd bit of code on Form Load. The 3rd bit of code I put on Form Unload.
When I debug I get the following error:
Compile Error:
Sub or Function not defined
uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
Code:
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
Code:
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
Code:
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