How to send & receive an sms using vb 6

Written by christopher hanson
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to send & receive an sms using vb 6
Text messaging continues to grow in popularity as cell phone technology advances. (texting a message on pda device image by Paul Hill from Fotolia.com)

SMS messaging, also known as text messaging, continues to grow in popularity. It is now used in emergency alert systems for college campuses and cities. Mobile banking has also incorporated SMS messaging. Computer programmers are finding SMS access increasingly important. New libraries created for Visual Basic 6 (VB 6) streamline the process of writing and receiving SMS messages. With the SMS services in place, programmers can incorporate messaging as a new interface for communicating with users.

Skill level:
Moderate

Other People Are Reading

Instructions

  1. 1

    Download and install SMSLibx. You will need to register for an account before the SMS library download is allowed. Once registration and download are complete, double-click the file to launch the installation wizard. Follow the instructions on the screen with the default settings.

  2. 2

    Launch Visual Basic Studios. Click "Start," "All Programs," "Visual Basic Studios," "Visual Basic Editor." The code editing software will appear on the screen.

  3. 3

    Access the SMS library via the reference list. Click "Project," "References," then select SMSLibx from the reference list and click "OK."

  4. 4

    Create the SMS modem object via a VB 6 declaration. In the code editor, type:

    Public WithEvents Modem As SMSModem

  5. 5

    Create a function to send messages in VB 6. In the code editor, below the line from the previous step, type:

    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)

    End Sub

  6. 6

    Create a function to receive messages in VB 6. In the code editor, below the send message function code, type:

    Private Sub nowRecieiveSMSMessage(Message As SMSLibX.SMSDeliver)

    MsgBox "New message received from " & Message.Originator & ":" _

    & vbCrLf & vbCrLf & Message.Body, _
    
    vbInformation, "New message received"
    

    End Sub

  7. 7

    Save the project. Click "Project," "Save," navigate to the "Documents" directory, then give the file a name and save it in VB format (the extension will be .vbscript). For example, the name could be sms.vbscript.

  8. 8

    Launch the command prompt. Click "Start," "Run," type "CMD.EXE" then press "Enter."

  9. 9

    Send an SMS message via VB 6. At the command prompt, for example type "c:\Documents\sms.vbscript nowSendSMSMessage('5555555555', 'this is a message')" then press "Enter." The message will be sent to the number.

  10. 10

    Receive SMS messages. At the command prompt, type "c:\Documents\sms.vbscript nowReceiveSMSMessage()" then press "Enter." The computer will wait for an SMS message to be displayed.

Tips and warnings

  • These functions can be incorporated into Web applications for streamline communication.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.