Sending and receiving texts is pretty simple on your phone. However, if you don't have your phone handy, you can program a simple application to receive SMS texts for you just using Visual Basic. Once you send messages, you'll be able to receive new ones back. Take your time when programming to make sure you get all of the commands correct. Otherwise, your program won't work.
- Skill level:
Other People Are Reading
Install SMSLibx, following the instructions with the install wizard. You can download SMSLibx online (see Resources).
Start your copy of Visual Basic to load the application. Click on "Projects" from the main menu, then select "References." Locate "SMSLibx" in the reference list and highlight it. Click "OK."
Make a Visual Basic declaration. This will be your SMS object. Once you have access to the declaration code editor, type the following:
Public WithEvents Modem As SMSModem
Input the following code just under the code you typed out in Step 3. This will be the function that sends your messages. Type out:
Private Sub nowSendSMSMessage(PhoneNumber, MessageText)
' Open modem communication
Set Modem = New SMSModem
Modem.LogTrace = True
Modem.OpenComm ModemType, ModemPort, , smsNotifyAll
' Send message
Call Modem.SendTextMessage(PhoneNumber, MessageText)
Input the following code just below the code added in Step 4. This will be the function to receive SMS messages. Type out:
Private Sub nowRecieiveSMSMessage(Message As SMSLibX.SMSDeliver)
MsgBox "New message received from " & Message.Originator & ":" _
& vbCrLf & vbCrLf & Message.Body, _
vbInformation, "New message received"
Click on "Project," then select "Save" from the menu bar to save your document. With the "Save" window open, locate the "Documents" directory, name the file "Messenger.vbscript" and click "Save."
Click the Windows "Start" menu in the lower left of your desktop, type "CMD.exe" and press "Enter" to open the Command Prompt in Windows Vista and later. In Windows XP and earlier, click "Start," click "Run," type "CMD.exe" and press "Enter."
Type the following in the Command Prompt, then press "Enter" to send a message:
c:\Documents\Messenger.vbscript nowSendSMSMessage('the phone number', 'input the message you want to send here')
Receive messages by inputting the following text into the Command Prompt and pressing "Enter":
This will let your computer wait for messages to come in.
Repeat Steps 8 and 9 to have a conversation.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for