Results 1 to 2 of 2

Thread: VB6 - Sending SMS

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    47

    VB6 - Sending SMS

    hi all, i developed a small app that would keep track of user defined buzz words on a website, the notification was e-mail, song, msg box but all of these are no good unless your sitting at a computer so i decided to create a way of sending a SMS message.

    This has been discussed before but i dont think theres a working sample.

    Basically i am using VB to fill in the information into a free SMS website.

    VB Code:
    1. '********************************************************
    2. '* Created by Antonio Cassidy AKA Nino                  *
    3. '* [email][email protected][/email]                         *
    4. '*                                                      *
    5. '*Add reference to Microsoft HTML Object Library        *
    6. '*Add component Microsoft Internet Controls             *
    7. '********************************************************
    8.  
    9. Option Explicit
    10. Dim hDoc As MSHTML.HTMLDocument
    11. Dim hInp As MSHTML.HTMLInputElement
    12.  
    13. 'counter to add a pause
    14. Dim pausecount As Integer
    15.  
    16. 'fills in the logon details to sign onto the SMS service
    17. Private Sub Command1_Click()
    18.     Set hInp = hDoc.getElementById("mobile")
    19.     hInp.focus
    20.     hInp.Value = txtuserName.Text
    21.     Set hInp = hDoc.getElementById("pin")
    22.     hInp.focus
    23.     hInp.Value = txtPin.Text
    24.     SendKeys "{ENTER}", True
    25.     Set hDoc = WebBrowser2.Document
    26.     Timer1.Interval = 1000
    27.     Timer1.Enabled = True
    28. End Sub
    29.  
    30. Private Sub Form_Load()
    31.     WebBrowser2.Navigate2 "http://www.bubbletext.co.uk/"
    32. End Sub
    33.  
    34.  
    35. 'I was experiencing problems with the sending message part it was
    36. 'trying to fill the information in before the page fully loaded,
    37. 'this will "pause" the program for a few seconds then call the message
    38. Private Sub Timer1_Timer()
    39. If pausecount > 2 Then
    40.  Call message
    41.  Timer1.Enabled = False
    42. End If
    43. pausecount = pausecount + 1
    44. End Sub
    45.  
    46. Private Sub WebBrowser2_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    47.     Set hDoc = WebBrowser2.Document
    48. End Sub
    49.  
    50. 'Sends the information from the text boxes to the online webform
    51. 'tabs and accepts the terms and conditions and tabs and presses
    52. 'enter
    53. Private Sub message()
    54.     Set hInp = hDoc.getElementById("mobile")
    55.     hInp.focus
    56.     hInp.Value = txtTo.Text
    57.     Set hInp = hDoc.getElementById("fromname")
    58.     hInp.focus
    59.     hInp.Value = txtfrom.Text
    60.     Set hInp = hDoc.getElementById("txtMessage")
    61.     hInp.focus
    62.     hInp.Value = txtText.Text
    63.     SendKeys "{TAB 2}", True
    64.     SendKeys " ", True
    65.     SendKeys "{TAB 2}", True
    66.     SendKeys "{ENTER}", True
    67. End Sub


    The code that deals with the data entry onto the website will be different for each website so some editing will be required but the service i picked was specifically due to the fact i could get the names of the fields and there were no OCR validation and of course its free and fast!!

    This is just a sample so theres no validation on the numbers entered etc

    If you want to see what the code is doing via the website turn the web browser to visible and it loads and enteres data so quick so theres not much to see lol

    Enjoy and let me know what anyone thinks!

    Thanks

    Nino
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: VB6 - Sending SMS

    Wow, I've actually been developing something just like this for a program that I'm currently writing. I've made it so that it'll send you an sms alert when you receive email in Gmail and it can even send you an MMS of the email content.
    I did it exactly the same way as you!!
    Great minds think alike...
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width