What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » How retrieves contact

How retrieves contact
Author: Message:
Zick
New Member
*


Posts: 9
Joined: Feb 2005
O.P. How retrieves contact
Hello, I'm currently condig a programm in Visual Basic and I've a little problem. In fact, I want to retrieves all name of all contact of the msn, and I proceed by groups like this :

code:
Public Contacts As MessengerAPI.IMessengerContacts
Public Contact As MessengerAPI.IMessengerContact
Public Groups As MessengerAPI.IMessengerGroups
Public Group As MessengerAPI.IMessengerGroup
Public mProperty As MCONTACTPROPERTY
Public mPhone As MPHONE_TYPE
Public msn As MessengerAPI.Messenger
Private Sub Command1_Click()
Set msn = New MessengerAPI.Messenger
Dim i, j, k As Long
Dim tGroup, tPhone, tProperty As String
i = 0
j = 0
k = 0
List4.Clear
List5.Clear
List6.Clear
List7.Clear
Set Groups = msn.MyGroups
For k = 0 To Groups.Count - 1
    Set Group = Groups( k)
    tGroup = Group.Name
    Set Contacts = Group.Contacts
    For j = 0 To Contacts.Count - 1
        i = j + 1
        Set Contact = Contacts(j)
        mPhone = MPHONE_TYPE_MOBILE
        mProperty = MCONTACTPROP_EMAIL
        tkey = "item" & k & "-" & i
        List4.AddItem Contact.FriendlyName
        List5.AddItem Contact.SigninName
        List6.AddItem Contact.Status
        List7.AddItem Group.Name
    Next
Next

End Sub

But if I hadn't put contact in groupe et display my contact by online/offline, no contact appears in list.

So how can I do for see the contact in the group ONline/Offline ?

This post was edited on 02-13-2005 at 12:30 AM by Zick.
02-12-2005 08:13 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: How retrieves contact
Can you use [code] tags please? Groups(K) looks just plain wrong...

Anyway...

The Contacts collection can handle any grouping of contacts, so msn.MyContacts is what you want for online/offline.
[Image: spartaafk.png]
02-12-2005 09:39 PM
Profile PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: How retrieves contact
quote:
Originally posted by Zick
Hello, I'm currently conding a program in Visual Basic and I've got a little problem. In fact, I want to retrieve the names of all contacts on my msn, and I proceed by groups like this :

code:
Public Contacts As MessengerAPI.IMessengerContacts
Public Contact As MessengerAPI.IMessengerContact
Public Groups As MessengerAPI.IMessengerGroups
Public Group As MessengerAPI.IMessengerGroup
Public mProperty As MCONTACTPROPERTY
Public mPhone As MPHONE_TYPE
Public msn As MessengerAPI.Messenger
Private Sub Command1_Click()
    Set msn = New MessengerAPI.Messenger
    Dim i, j, k As Long
    Dim tGroup, tPhone, tProperty As String
    i = 0
    j = 0
    k = 0
    List4.Clear
    List5.Clear
    List6.Clear
    List7.Clear
    Set Groups = msn.MyGroups
    For k = 0 To Groups.Count - 1
        Set Group = Groups(k)
        tGroup = Group.Name
        Set Contacts = Group.Contacts
        For j = 0 To Contacts.Count - 1
            i = j + 1
            Set Contact = Contacts(j)
            mPhone = MPHONE_TYPE_MOBILE
            mProperty = MCONTACTPROP_EMAIL
            tkey = "item" & k & "-" & i
            List4.AddItem Contact.FriendlyName
            List5.AddItem Contact.SigninName
            List6.AddItem Contact.Status
            List7.AddItem Group.Name
        Next
    Next

End Sub

But if I hadn't sorted my contacts in group display but rather by online/offline, no contacts appear in the list.

So how can I see the contacts when sorted in Online/Offline ?

Put code tags around it and made a futile attempt at ajusting the spacing. Hope this makes it a little easier to read. lol, don't get me confused with Zick who origionally posted this!

This post was edited on 02-12-2005 at 11:11 PM by ShawnZ.
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
02-12-2005 10:43 PM
Profile PM Web Find Quote Report
Zick
New Member
*


Posts: 9
Joined: Feb 2005
O.P. RE: How retrieves contact
Sorry I'm new here ...

I'm gonna try with msn.MyContact
No matter , anyway the problem is fixed.

Sorry for my english but I'm french an I don't speak english very well :(
02-12-2005 10:46 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On