Sachin2k6
Active Member
- Joined
- Mar 3, 2012
- Messages
- 369
Hi all,
Sorry for violating the forum rules but i have to restart the thread as the original have a lot of confusing replies.
I'm working on a management program for a small company. As one of it's feature i need a procedure which send a prewritten SMS to it's employees using a web service like 160by2.com (10 employees at a time.).
After a long search in forum, with the help of found codes i managed the following code and login successfully on the site 160by2.com
But to proceed further and access the send sms page i can't get the elements of the next page to click that.
How this code can be extended to access send sms page and send an sms to a particular number(s)????
Sorry for violating the forum rules but i have to restart the thread as the original have a lot of confusing replies.
I'm working on a management program for a small company. As one of it's feature i need a procedure which send a prewritten SMS to it's employees using a web service like 160by2.com (10 employees at a time.).
After a long search in forum, with the help of found codes i managed the following code and login successfully on the site 160by2.com
Code:
[I]Sub SendSMS()
Const cURL = "http:\\www.160by2.com"
Const cUsername = "XXXXX" 'REPLACE XXXX WITH YOUR USER NAME
Const cPassword = "YYYYY" 'REPLACE YYYY WITH YOUR PASSWORD
Dim IE As InternetExplorer
Dim doc As HTMLDocument
Dim LoginForm As HTMLFormElement
Dim UserNameInputBox As HTMLInputElement
Dim PasswordInputBox As HTMLInputElement
Dim SignInButton As HTMLInputButtonElement
Dim HTMLelement As IHTMLElement
Set IE = New InternetExplorer
IE.Visible = True
IE.navigate cURL
'Wait for initial page to load
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Set doc = IE.document
'Get the only form on the page
Set LoginForm = doc.forms(0)
'Get the User Name textbox and populate it
Set UserNameInputBox = LoginForm.elements("username")
UserNameInputBox.Value = cUsername
'Get the password textbox and populate it
Set PasswordInputBox = LoginForm.elements("password")
PasswordInputBox.Value = cPassword
'Get the form input button and click it
Set SignInButton = LoginForm.elements("button")
SignInButton.Click
'Wait for the new page to load
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
'Login succeeded here.
End Sub
[/I]
But to proceed further and access the send sms page i can't get the elements of the next page to click that.
How this code can be extended to access send sms page and send an sms to a particular number(s)????