Click here to Skip to main content
15,896,473 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
I have looked at a vbs example to send an SMS via Skype4Com but am not able to run it in VB6 probably due to my lack of experience with vbs!

1.I need to make declarations to the Skype4Com.dll
2.Attach to Skype
3.Start Skype if it is not running
4.Send the SMS.


My code so far:

VB
Sub mainSMS()

'Create a Skype4COM object:
Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_") 'Generates "Object required" at runtime.

'Start the Skype client:
If Not oSkype.Client.IsRunning Then
   'oSkype.Client.Start() Generates 'Compile error: expected "="
   oSkype.Client.Start        'No error generated but runtime has not got this far!
End If

'Send SMS:
Set oSms = oSkype.SendSms(MobileNumber, "Test")
WScript.Sleep (60000)  'What is WScript???

MsgBox ("Done")

End Sub


I am running VB6 on Vista on a PC.

Does anyone have a working example please?

Thank you.
Posted
Updated 18-Feb-10 2:15am
v5

Did you register the DLL?
 
Share this answer
 
Note that since these solutions were published, the Skype API has been obsoleted by Microsoft-- indeed, they simply "secretly" downgraded everyone's Skype in September 2013 (ref link below). There's been a huge uproar as you would expect from software engineers and even entire companies that have wasted gallons of time developing products around Skype. There is something called a URI, but it's extremely simple and you can't do SMSs with it (yet anyway).
See https://aragonresearch.com/microsoft-kills-skype-desktop-apis-leaves-developers-scrambling/[^]
 
Share this answer
 
Franc Volke wrote:
I am running VB6 on Vista on a PC.


You realise that by the time Vista was written, VB6 had been obsolete and unsupported for some time ? You should learn VB.NET, it's a real language, with lots of support and lots of job opportunities.
 
Share this answer
 
Comments
Member 9540139 4-Dec-12 9:10am    
Hello Christian -- It's well known that VB6 is superior to VB.net in respect of RAD (and the resulting exe is faster and still supported in win8), and is thus still widely used for RAD and small util apps. We support both as do some major banks (search job ads). I for one am thus still interested in this question... I am also mildly intrigued as to why some feel compelled to promote one's own belief and denigrate others (evident by suggesting VB6 isn't "real"). It has a damning effect which is not helpful. Microsoft should upgrade true VB6 as 'Net just is not the same. Cheers.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900