'********************************************************
'* Created by Antonio Cassidy AKA Nino *
'* *
'*Add reference to Microsoft HTML Object Library *
'*Add component Microsoft Internet Controls *
'********************************************************
Option Explicit
Dim hDoc As MSHTML.HTMLDocument
Dim hInp As MSHTML.HTMLInputElement
'counter to add a pause
Dim pausecount As Integer
'fills in the logon details to sign onto the SMS service
Private Sub Command1_Click()
Set hInp = hDoc.getElementById("mobile")
hInp.focus
hInp.Value = txtuserName.Text
Set hInp = hDoc.getElementById("pin")
hInp.focus
hInp.Value = txtPin.Text
SendKeys "{ENTER}", True
Set hDoc = WebBrowser2.Document
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
WebBrowser2.Navigate2 "http://www.bubbletext.co.uk/"
End Sub
'I was experiencing problems with the sending message part it was
'trying to fill the information in before the page fully loaded,
'this will "pause" the program for a few seconds then call the message
Private Sub Timer1_Timer()
If pausecount > 2 Then
Call message
Timer1.Enabled = False
End If
pausecount = pausecount + 1
End Sub
Private Sub WebBrowser2_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Set hDoc = WebBrowser2.Document
End Sub
'Sends the information from the text boxes to the online webform
'tabs and accepts the terms and conditions and tabs and presses
'enter
Private Sub message()
Set hInp = hDoc.getElementById("mobile")
hInp.focus
hInp.Value = txtTo.Text
Set hInp = hDoc.getElementById("fromname")
hInp.focus
hInp.Value = txtfrom.Text
Set hInp = hDoc.getElementById("txtMessage")
hInp.focus
hInp.Value = txtText.Text
SendKeys "{TAB 2}", True
SendKeys " ", True
SendKeys "{TAB 2}", True
SendKeys "{ENTER}", True
End Sub