Messenger autoresponder
Jeg fandt nedenstående kode på nettet, men får fejl ved den første linie: Dim WithEvents msnobj As MsgrObject"User-defined type not defined". Hvad er der galt?
'**************************************
' Name: Auto Responder For MSN Messenger
'
' Description:By Using This If Someones
' IM's You On MSN Messenger This Program W
' ill Automatically Send A Message Back
' By: Aden R
'
'This code is copyrighted and has' limited warranties.Please see http://w
' ww.Planet-Source-Code.com/xq/ASP/txtCode
' Id.39990/lngWId.1/qx/vb/scripts/ShowCode
' .htm'for details.'**************************************
'Put One Text Box
'Goto The Menu At The Top, Click Project
' s
'Goto References And Scroll Down To
'Messenger Type 1.0 Library
'Check It
'Auto Responder
'First Set The Declerations:
Dim WithEvents msnobj As MsgrObject
'Then Set The Recognition Code So Visual
' Basic Can Recognize MSN:
Private Sub Form_Load()
Set msnobj = New MsgrObject
End Sub
'Then Set The Main Code:
Private Sub msnobj_OnTextReceived(ByVal pIMSession As Messenger.IMsgrIMSession, ByVal pSourceUser As Messenger.IMsgrUser, ByVal bstrMsgHeader As String, ByVal bstrMsgText As String, pfEnableDefault As Boolean)
pSourceUser.SendText bstrMsgHeader, Text1.Text, MMSGTYPE_NO_RESULT
End Sub
'Then Set The Module To Avoid Recognitio
' n Code Errors:
Option Explicit
Public MSN As Messenger.MsgrObject
Public Sub Main()
Set MSN = New Messenger.MsgrObject 'create new instance of the MSN object
End Sub
