Visual Basic Skype Mass Message

Introduction: This tutorial you will learn how to create a mass message program for Skype in Visual Basic. Steps of Creation: Step One: First we need to include the Skype API so go to Project > Add Reference > COM > Skype4COM. Step Two: Now add a button to our form which will begin the mass message process and a text box to enter the message to send to everyone. Step Three: Next we need to create a variable to contain our Skype client. Put this above any Sub's so we can use it throughout our file if you want to add more features:
  1.         Dim iSkype As New SKYPE4COMLib.Skype
Step Four: Now double click on the button. First we are going to attach our program to Skype, then we will create a msg variable to contain our message from TextBox1
  1.         iSkype.Attach()
  2.         Dim msg As String = TextBox1.Text
Step Five: Finally lets iterate through all of the users within our contact list and send them all the message:
  1.     Dim msg As String = TextBox1.Text
  2.     For Each u As SKYPE4COMLib.User In iSkype.Friends
  3.         iSkype.SendMessage(u.Handle, msg)
  4.     Next
Project Completed! That's as simple as it is to make a Mass Message Skype Program. Here's the finished source code:
  1.         Public Class Form1
  2.                 Dim iSkype As New SKYPE4COMLib.Skype
  3.                 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  4.                         iSkype.Attach()
  5.                         Dim msg As String = TextBox1.Text
  6.                         For Each u As SKYPE4COMLib.User In iSkype.Friends
  7.                                 iSkype.SendMessage(u.Handle, msg)
  8.                         Next
  9.                 End Sub
  10.         End Class

Comments

Add new comment