ok in the same class module...
code:
Public Sub oMessenger_OnContactStatusChange ( some thing something....)
if pMContact.status = MISTATUS_ONLINE then
oMessenger.InstantMessage pMContact.signinname
SendKeys "Insert Message Here"
Call PostMessage("IMWindowClass", WM_CLOSE, 0, 0)
end if
end sub
something like that