Skype4COM: Groupchat.vbs

Skype4COM

Groupchat.vbs

This script creates a group chat.

Copyright � 2004-2006 Skype Limited. Licensed under BSD license.

'// Create a Skype4COM object:
Set oSkype = WScript.CreateObject("Skype4COM.Skype","Skype_")

'// Start the Skype client:
If Not oSkype.Client.IsRunning Then oSkype.Client.Start() End If

'// Create a UserCollection object and add the multichat users to this collection:
Set oMembers = CreateObject("Skype4COM.UserCollection")
oMembers.Add(oSkype.User("skypeuser2"))
oMembers.Add(oSkype.User("skypeuser3"))

'// Create a multichat:
Set oChat = oSkype.CreateChatMultiple(oMembers)

'// Open a chat window:
oChat.OpenWindow

'// Set a chat topic:
oChat.Topic = "Skype is cool"

'// Send a chat message:
Set oMsg = oChat.SendMessage("Greetings!")

'// Leave a chat:
oChat.Leave

'// The AttachmentStatus event handler monitors attachment status and automatically attempts to reattach to the API following loss of connection:
Public Sub Skype_AttachmentStatus(ByVal aStatus)
  WScript.Echo ">Attachment status " & oSkype.Convert.AttachmentStatusToText(aStatus)
  If aStatus = oSkype.Convert.TextToAttachmentStatus("AVAILABLE") Then oSkype.Attach() End If
End Sub

Copyright � 2006 Skype Limited. All rights reserved.