|
-
Jul 25th, 2003, 07:47 PM
#1
Thread Starter
Hyperactive Member
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:
Dim oMSN
Set oMSN = CreateObject("Messenger.UIAutomation")
Dim i, oContact, oContacts
Set oContacts = oMSN.MyContacts
For i = 0 To oContacts.Count - 1
Set oContact = oContacts.Item(i)
MsgBox oContact.FriendlyName
Next
Any help highly appreciated, cheers.
-adehh
-
Jul 26th, 2003, 05:00 PM
#2
Thread Starter
Hyperactive Member
-
Jul 29th, 2003, 04:39 AM
#3
Member
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
------------------------------------------
-
Jul 29th, 2003, 07:40 PM
#4
Thread Starter
Hyperactive Member
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
-
Jul 29th, 2003, 11:19 PM
#5
Frenzied Member
Just toughts, I didn't test it. I see you already have a collection of contacts, so just try this:
VB Code:
Dim oMSN, oContact
Set oMSN = CreateObject("Messenger.UIAutomation")
For Each oContact In oMSN.oContacts
MsgBox oContact.FriendlyName
Next
-
Jul 30th, 2003, 08:27 PM
#6
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|