vb_msn_messenger_related
- Hi,
i want work with msn messenger to start work first i am trying to get email of all contacts list using
Public msn As MessengerAPI.Messenger
Private Sub command1_click()
Dim msncontact As imessengercontact
Dim msncontacts As imessengercontacts
Set msncontacts = msn.mycontacts
For Each msncontact In msncontacts
List1.AddItem (msncontact.signinname)
Next
End Sub
Private Sub Form_Load()
Set msn = New MessengerAPI.Messenger
End Sub
code but i got "method mycontacts of object imessenger3 failed" error on "Set msncontacts = msn.mycontacts" line when i run code i have also add "messenger api type library" reference
Answers
Hi Geeta,
Welcome to MSDN forums!This tutorial explains the MessengerAPI COM object, and how to use this API to retrieve contacts list in VB.NET.
http://www.dreamincode.net/forums/showtopic38991.htm
Code sample:
Dim objMSN As New MessengerAPI.Messenger
Dim msncontact As MessengerAPI.IMessengerContact
Dim msncontacts As MessengerAPI.IMessengerContacts = objMSN.MyContacts
' Loop through all the contacts and add the SigninName to the list.
For Each msncontact In msncontacts
chlContacts.Items.Add(msncontact.SigninName)
Next
Illustration:
Additionally, Sticky: For Visual Basic 6 questions, please read...
Here is similar issue to yours. It seems that some plug-in need installed.
http://forum.mess.be/index.php?showtopic=18699
Best regards,
Martin Xie
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byMartin Xie - MSFTMSFT, ModeratorMonday, November 09, 2009 3:01 AM
All Replies
Hi Geeta,
Welcome to MSDN forums!This tutorial explains the MessengerAPI COM object, and how to use this API to retrieve contacts list in VB.NET.
http://www.dreamincode.net/forums/showtopic38991.htm
Code sample:
Dim objMSN As New MessengerAPI.Messenger
Dim msncontact As MessengerAPI.IMessengerContact
Dim msncontacts As MessengerAPI.IMessengerContacts = objMSN.MyContacts
' Loop through all the contacts and add the SigninName to the list.
For Each msncontact In msncontacts
chlContacts.Items.Add(msncontact.SigninName)
Next
Illustration:
Additionally, Sticky: For Visual Basic 6 questions, please read...
Here is similar issue to yours. It seems that some plug-in need installed.
http://forum.mess.be/index.php?showtopic=18699
Best regards,
Martin Xie
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byMartin Xie - MSFTMSFT, ModeratorMonday, November 09, 2009 3:01 AM


