MarkCBB
Active Member
- Joined
- Apr 12, 2010
- Messages
- 497
Hi there,
I found the following code that sends a Skype message. It works perfectly when I add the Skype object reference manually. However I would like to distribute this code, is there a away to use late binding to automatically add the Skype reference on run time? Below is the code.
I found the following code that sends a Skype message. It works perfectly when I add the Skype object reference manually. However I would like to distribute this code, is there a away to use late binding to automatically add the Skype reference on run time? Below is the code.
Code:
Sub Skype_ContactCount()
Dim aSkype As SKYPE4COMLib.Skype
Dim int_NumberOfSkypeUserContacts
Set aSkype = New SKYPE4COMLib.Skype
int_NumberOfSkypeUserContacts = aSkype.Friends.Count
Dim oChat As chat
Dim skUser As SKYPE4COMLib.user
Set skUser = aSkype.user("UserName") ' Add Skype name here
Set oChat = aSkype.CreateChatWith(skUser.Handle)
oChat.OpenWindow
oChat.SendMessage "Hello " & skUser.FullName & " " & Application.UserName & " has " & int_NumberOfSkypeUserContacts & " Skype contacts"
End Sub