Results 1 to 6 of 6

Thread: Messenger API (version 6) in VBScript

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506

    Messenger API (version 6) in VBScript

    Hi, I'm trying to list my MSN contacts in a local webpage via VBS, I've successfully created the MSN object but trouble arises when I try to extract property values from the 'contacts'; of which I'm beginning to believe aren't actually being created.
    Heres the code I'm using:
    VB Code:
    1. Dim oMSN
    2.     Set oMSN = CreateObject("Messenger.UIAutomation")
    3.    
    4.     Dim i, oContact, oContacts
    5.     Set oContacts = oMSN.MyContacts
    6.  
    7.     For i = 0 To oContacts.Count - 1
    8.         Set oContact = oContacts.Item(i)
    9.         MsgBox oContact.FriendlyName
    10.     Next
    Any help highly appreciated, cheers.
    -adehh

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    *B U M P*

  3. #3
    Member
    Join Date
    Apr 2003
    Location
    Australia
    Posts
    34
    i cant help u but maybe you can help me
    can you please tell me how to create a msnmessenger6 object...also in vb6
    thx
    ------------------------------------------
    Private Sub Problem()
    If resolved.Value = True Then
    MsgBox "Resolved Query", vbInformation, "Resolved"
    End If
    End Sub
    ------------------------------------------
    Public Sub aspnow()
    Me.DoingASPNow = true
    End Sub
    ------------------------------------------

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    You could use 1 of 2 methods:
    [list=1][*]Add a reference to the Messenger API found in Project>References, then use the code Dim oMSN As New Messenger.[*]Use the following code:
    Dim oMSN As Object
    Set oMSN = CreateObject("Messenger.UIAutomation")[/list=1]
    They both do the same thing, but creating a reference is normally easier in the long run, cheers.
    -adehh

  5. #5
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Just toughts, I didn't test it. I see you already have a collection of contacts, so just try this:
    VB Code:
    1. Dim oMSN, oContact
    2.  
    3.     Set oMSN = CreateObject("Messenger.UIAutomation")
    4.  
    5.     For Each oContact In oMSN.oContacts
    6.         MsgBox oContact.FriendlyName
    7.     Next

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    I thought that could of been it then but it gave me the same error as usual:
    ---------------------------
    Windows Script Host
    ---------------------------
    Script: C:\asdads.vbs
    Line: 5
    Char: 5
    Error: Object doesn't support this property or method: 'oContacts'
    Code: 800A01B6
    Source: Microsoft VBScript runtime error
    ---------------------------
    OK
    ---------------------------
    -adehh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width