Skype - Problem Sending Multiple SMS (1 Viewer)

CharlesWhiteman

Registered User.
Local time
Today, 19:59
Joined
Feb 26, 2007
Messages
421
I'm using the following code which successfully allows me to send a contact a SMS message from a MS Access Form.

I'm haivng a problem trying to get the code to look at a table and send an sms message row. The error i get is: Microsoft Visual Basic Compile Error: ByRef argument type mismatch

I am successfully using the code where the smsnumber and message are textboxes in a form. I'm trying to get this to look at a table containing multiple messages to send.

Code:
Set mydb = CurrentDb()
Set rs = mydb.OpenRecordset("TblSmsMessages", dbOpenSnapshot)
With rs
.MoveFirst
Do Until rs.EOF
If IsNull(rs.Fields(2)) = False Then
SkypeSMS SmsNumber, SMSMessage
End If
.MoveNext
Loop
End With
rs.Close
Set mydb = Nothing
Set rs = Nothing
End Sub
 

HiTechCoach

Well-known member
Local time
Today, 13:59
Joined
Mar 6, 2006
Messages
4,357
I'm using the following code which successfully allows me to send a contact a SMS message from a MS Access Form.

I'm haivng a problem trying to get the code to look at a table and send an sms message row. The error i get is: Microsoft Visual Basic Compile Error: ByRef argument type mismatch

I am successfully using the code where the smsnumber and message are textboxes in a form. I'm trying to get this to look at a table containing multiple messages to send.

Code:
Set mydb = CurrentDb()
Set rs = mydb.OpenRecordset("TblSmsMessages", dbOpenSnapshot)
With rs
.MoveFirst
Do Until rs.EOF
If IsNull(rs.Fields(2)) = False Then
SkypeSMS SmsNumber, SMSMessage
End If
.MoveNext
Loop
End With
rs.Close
Set mydb = Nothing
Set rs = Nothing
End Sub

I would be glad to help you get the code working to read a table.


I assume the line that is getting the error is:

SkypeSMS SmsNumber, SMSMessage

So I can try to test your code, would you mind posting the VBA code for the SkypeSMS routine?
 

darbid

Registered User.
Local time
Today, 20:59
Joined
Jun 26, 2008
Messages
1,428
I did not know that skype was offering a COM compliant addin. Cool.
 

HiTechCoach

Well-known member
Local time
Today, 13:59
Joined
Mar 6, 2006
Messages
4,357
Try this:
Code:
Set mydb = CurrentDb()
Set rs = mydb.OpenRecordset("TblSmsMessages", dbOpenSnapshot)
With rs
.MoveFirst
Do Until rs.EOF
If Not IsNull(rs!SmsNumber) and Not IsNull(rs!SMSMessage) Then
SkypeSMS [B]rs![/B]SmsNumber, [B]rs![/B]SMSMessage
End If
.MoveNext
Loop
End With
rs.Close
Set mydb = Nothing
Set rs = Nothing
End Sub
 

CharlesWhiteman

Registered User.
Local time
Today, 19:59
Joined
Feb 26, 2007
Messages
421
Here is a sample Db with a form with code to send a text message to a mobile telephone.

Another button with the donated code that will send a txt message to multiple numbers. In this case based on a Table but I will test and ocnfirm it could equally be a query.

Requires skype4com which can be googled and downloaded and then registered and added as a reference.

This is sooo good since it avoids the need for SMS messaging server software. And so simple (when you know how). :eek::):D
 

Attachments

  • Skype SMS.zip
    28.6 KB · Views: 506

darbid

Registered User.
Local time
Today, 20:59
Joined
Jun 26, 2008
Messages
1,428
Hi Charles,

I like new things and remember someone a long time ago asking about skype and VBA - at that time this COM.dll did not exist.

I would have liked to see your database but I do not have 2007 so could not, but thanks for putting in an example.

I will have to think up a reason to add it to my database :)
 

CharlesWhiteman

Registered User.
Local time
Today, 19:59
Joined
Feb 26, 2007
Messages
421
Here is an Access 2003 .mdb version
 

Attachments

  • Skype SMS Access 2003.zip
    19.8 KB · Views: 357

darbid

Registered User.
Local time
Today, 20:59
Joined
Jun 26, 2008
Messages
1,428
Very cool and thanks for doing that.

by the way given that the SKYPE dll is not used often you might look at late binding it so that people can still use the rest of your DB.

I have learnt that rare and unsual addins = ".dll time is nightmare time".
 

CharlesWhiteman

Registered User.
Local time
Today, 19:59
Joined
Feb 26, 2007
Messages
421
Thanks for the comments and info. I kind of know what late binding is but havent yet mastered it. Any info on that would be great.
 

DCrake

Remembered
Local time
Today, 19:59
Joined
Jun 8, 2005
Messages
8,632
So I have Skype on my machine, are we saying that as I have the dll installed I can send sms messages to Skype and none skype users?
 

darbid

Registered User.
Local time
Today, 20:59
Joined
Jun 26, 2008
Messages
1,428
There is lots in the forum on this and I am not an expert. I will give you the dumb me idea...


David's "dumb me" explanation
If you implement late binding, instead of declaring a named object you just declare an object. You also remove the reference.

Thus when this database starts no errors will be detected.

Access will only check for this .dll when it is really needed or called.

Now all you need to do is to stop people from using your code if they do not have the .dll.


I THINK IT is

Code:
Dim sky As object

Set sky = CreateObject("SKYPE4COMLib.skype")
To stop people using this code if they do not have it is a little tricky.

1. you can check for the existance of the .dll but they might have it installed somewhere else.
2. The best way is to check in the registry. It should always be in the same place.
 

DCrake

Remembered
Local time
Today, 19:59
Joined
Jun 8, 2005
Messages
8,632
Darib,
I am aware of the late binding issue, the crux of my question still remains unanswered.
 

CharlesWhiteman

Registered User.
Local time
Today, 19:59
Joined
Feb 26, 2007
Messages
421
I guess we should leave late binding to another post on the specific issue.

To use the SkypeCom.dll you need:

Skype installed on your local PC
Download the Skype Com Addin & Register it. (Plenty on this if you goggle)
Once registered, add the reference into your Db
Create the SkypeMod Module

More info at: http://www.vb123.com/toolshed/06_access/skypesample.htm
 

darbid

Registered User.
Local time
Today, 20:59
Joined
Jun 26, 2008
Messages
1,428
Darib,
I am aware of the late binding issue, the crux of my question still remains unanswered.

Sorry mate I was writing an answer to something else when you wrote your text so yours came before mine.

I am with you, I would like to know more about it.

I don't suppose it would also set up a call from acccess as well?

So you could be on a form and click a name and it will open skype and call them?
 

HiTechCoach

Well-known member
Local time
Today, 13:59
Joined
Mar 6, 2006
Messages
4,357
Darib,
I am aware of the late binding issue, the crux of my question still remains unanswered.

It is possible to send SMS's with Skype if you have credits. AFAIK, it is not a free service.
 

HiTechCoach

Well-known member
Local time
Today, 13:59
Joined
Mar 6, 2006
Messages
4,357
Sorry mate I was writing an answer to something else when you wrote your text so yours came before mine.

I am with you, I would like to know more about it.

I don't suppose it would also set up a call from Access as well?

So you could be on a form and click a name and it will open skype and call them?

When browsing the web, phone numbers on web pages become Skype links to dial the number.

I would be surprised if you could not initiate a call from Access with Skype.
 
Last edited:

petehilljnr

Registered User.
Local time
Today, 11:59
Joined
Feb 13, 2007
Messages
192
If anyone is interested, I have written up a prototype for sending bulk messages out to members of my rugby club using my phone (unlimited free text messages you see...) and using Dial Up Networking and Bluetooth and AT commands.

It's not particularly special, but if you have a semi-decent phone (with either Bluetooth or a USB connection that supports DUN) and unlimited free texts (not too uncommon these days), then you hold a fair bit of communication power.

Works well enough at the moment. Gets through about a text per 2 seconds (I only send out 50 out at a time to various teams about game times / cancellations etc)

Only works on COM 1-4 because mscomm ocx doesn't work anymore and am using an alternative.

Pete
 

Users who are viewing this thread

Top Bottom