-
Re: sending sms with listview and checkbox in listview
let me show you part of the sending code
lsXml = lsXml & "<BODY><CONTENT>" & "here i need to write the number to send to, if i write LsVw.SelectedItem it will work? "</CONTENT><DEST_LIST>"
LsVw is the listview
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
Does your SMS API provider allows multiple "<TO>" tags ? If so, just loop through the ListView items and for items which have the check mark, include that mobile number within <TO> tags.
:wave:
what do you meen multiple tags?
i can send how many sms i want i buy the sms:)
-
Re: sending sms with listview and checkbox in listview
if i will write between the lines of the sending sms " listview.selecteditem
it will send to who evere i choose?
-
Re: sending sms with listview and checkbox in listview
Code:
ListView1.SelectedItem.Text ' <-- will give you the first column
ListView1.SelectedItem.SubItems(1) ' <-- will give you the second column and so on..
:wave:
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
Code:
ListView1.SelectedItem.Text ' <-- will give you the first column
ListView1.SelectedItem.SubItems(1) ' <-- will give you the second column and so on..
:wave:
im sry didnt understand
i put this between the sms code?
can you tell me where i put it in the code?
lsXml = lsXml & "<BODY><CONTENT>" & "like this ListView1.SelectedItem.SubItems(1)"</CONTENT><DEST_LIST>"
LsVw is the listview
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
if i will write between the lines of the sending sms " listview.selecteditem
it will send to who evere i choose?
I mean, will they allow this:
Code:
'....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>12345</TO>"
lsXml = lsXml & "<TO>98744445</TO>"
lsXml = lsXml & "<TO>20548</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
'...
That is multiple items.
:wave:
-
Re: sending sms with listview and checkbox in listview
[QUOTE=salsa31;4177355]let me show you part of the sending code
l LsVw.SelectedItem it will work?
you will have to change this code to list then it will snd
but u will have to bring whole data of database to text data base
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
I mean, will they allow this:
Code:
'....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>12345</TO>"
lsXml = lsXml & "<TO>98744445</TO>"
lsXml = lsXml & "<TO>20548</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
'...
That is multiple items.
:wave:
ahh
no
beacuse this code needs to be compiled and send to a customer of the company
-
Re: sending sms with listview and checkbox in listview
[QUOTE=useruseronline;4177363]
Quote:
Originally Posted by
salsa31
let me show you part of the sending code
l LsVw.SelectedItem it will work?
you will have to change this code to list then it will snd
but u will have to bring whole data of database to text data base
didntwork
-
Re: sending sms with listview and checkbox in listview
[QUOTE=salsa31;4177366]
Quote:
Originally Posted by
useruseronline
didntwork
u r doing it wrong because ur data is mdb format bring it in to two files as i did
the draw the list and code accordingly
-
Re: sending sms with listview and checkbox in listview
look everybody this is the code for the send sms
what do i write between this lines where text2 is?if i have a listview i meen
sXml = lsXml & "<TO>" & Text2 & "</TO>"
-
Re: sending sms with listview and checkbox in listview
Assuming, your API provider allows multiple TO elements.
vb Code:
Private Function getSelectedNums() As String
Dim temp As String
temp = ""
Dim i As Long
For i = 1 To ListView1.ListItems.Count '~~~ Loop through the listview
If ListView1.ListItems(i).Checked = True Then '~~~ if an item is checked
temp = temp & "<TO>" & ListView1.ListItems(i).SubItems(1) & "</TO>" & vbCrLf '~~~ enclose the number in "<TO>" tags
End If
Next
getSelectedNums = temp '~~~ return it
End Function
:wave:
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
Assuming, your API provider allows multiple TO elements.
vb Code:
Private Function getSelectedNums() As String
Dim temp As String
temp = ""
Dim i As Long
For i = 1 To ListView1.ListItems.Count '~~~ Loop through the listview
If ListView1.ListItems(i).Checked = True Then '~~~ if an item is checked
temp = temp & "<TO>" & ListView1.ListItems(i).SubItems(1) & "</TO>" & vbCrLf '~~~ enclose the number in "<TO>" tags
End If
Next
getSelectedNums = temp '~~~ return it
End Function
:wave:
where do i put this code?
i just want to be able to choose a contact form the listview and send him a sms
-
Re: sending sms with listview and checkbox in listview
the only code that i can use is this
sXml = lsXml & "<TO>" & Text2 & "</TO>"
you see the text 2?
if i write the number there it sends sms with no problem
-
Re: sending sms with listview and checkbox in listview
exactly u can do this with text file format
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
exactly u can do this with text file format
the only code that i can use is this
sXml = lsXml & "<TO>" & Text2 & "</TO>"
you see the text 2?
if i write the number there it sends sms with no problem
only the listview can help me to selcet 1 or all to send sms
look at the picture
-
Re: sending sms with listview and checkbox in listview
Try it here:
Code:
'....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & getSelectedNums()
lsXml = lsXml & "</DEST_LIST></BODY>"
'...
Do you have the docs for that API ?
:wave:
-
1 Attachment(s)
Re: sending sms with listview and checkbox in listview
-
Re: sending sms with listview and checkbox in listview
see this file done :) just select list and click send
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
Try it here:
Code:
'....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & getSelectedNums()
lsXml = lsXml & "</DEST_LIST></BODY>"
'...
Do you have the docs for that API ?
:wave:
yes
Dim args
Set winObj = CreateObject("WinHttp.WinHttpRequest.5.1")
Call winObj.Open("POST", "https://cellactpro.net/GlobalSms/ExternalClient/GlobalAPI.asp", False)
winObj.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
winObj.setRequestHeader "User-Agent", "Message Test"
winObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Build the XML for sending
lsXml = "<PALO><HEAD><FROM>ammishov</FROM><APP USER=""******"" PASSWORD=""******""/><CMD>sendtextmt</CMD></HEAD>"
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>" & Text2 & "</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
lsXml = lsXml & "<OPTIONAL><CALLBACK> " & Text3 & "</CALLBACK></OPTIONAL></PALO>"
'wscript.echo lsXml
lsXml = ReplaceData(lsXml)
SendString = "XMLString=" & lsXml
winObj.send (SendString)
result = winObj.responseText
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
'Replace Problematic Chars
Function ReplaceData(ByRef data)
data = Replace(data, "%", "%25")
data = Replace(data, " ", "%20")
data = Replace(data, "#", "%23")
data = Replace(data, "&", "%26")
data = Replace(data, "?", "%3F")
data = Replace(data, "+", "%2B")
data = Replace(data, "/n", "%0A")
ReplaceData = data
End Function
-
Re: sending sms with listview and checkbox in listview
see my file its working correctly
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
see my file its working correctly
your file is working but it dosnt pull the db customers
i need a listview:(
-
Re: sending sms with listview and checkbox in listview
I was asking for the API manual. Or if you know the website of your service provider, let me know. So that I could check the manual and check whether they allow multiple recipients in a single shot.
@useruseronline: Avoid posting EXE files. Post source code instead.
:wave:
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
I was asking for the API manual. Or if you know the website of your service provider, let me know. So that I could check the manual and check whether they allow multiple recipients in a single shot.
@useruseronline: Avoid posting EXE files. Post source code instead.
:wave:
this?
-
Re: sending sms with listview and checkbox in listview
this is the text code they send me
-
Re: sending sms with listview and checkbox in listview
can u write the customer name and numbers in text file and attach
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
can u write the customer name and numbers in text file and attach
i did it at the begining but this will not help man:(
only the listview can save the the day for me.
-
Re: sending sms with listview and checkbox in listview
dont use data base to save recordsssss use text file
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
dont use data base to save recordsssss use text file
i cant change the programm that i worked for a year bro.
the whole project relies on the DB
i have like 20 forms using this DB
-
Re: sending sms with listview and checkbox in listview
plz akhileshbc can you help me with the listview?
-
Re: sending sms with listview and checkbox in listview
oh ok that a real problem :)
-
Re: sending sms with listview and checkbox in listview
what problem are u facing isnt it sending msg or not putting the phone number in text2 ?
-
Re: sending sms with listview and checkbox in listview
you see this code?
lsXml = lsXml & "<TO>" & Text2 & "</TO>"
the text 2 is where i put the number and sends and its working.
but if i want to select all the users or 5 persons to send sms?
thats why i need a listview for that.
to select multiply numbers or just a couple of them
you get me my friend?
-
Re: sending sms with listview and checkbox in listview
i need a listview that i can pick which person to send sms to thats it
-
Re: sending sms with listview and checkbox in listview
got u pro .. add code to lsvw click event
when clicked it should add the text of item selected to listbox
then from there use my method can u do that ?
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
got u pro .. add code to lsvw click event
when clicked it should add the text of item selected to listbox
then from there use my method can u do that ?
no exactly
lets say i have 10 customers ok?
in a listview
now i want to pick 3 customers and send them the sms
something is missing in the middle of this code so that it will know i choosed 3 customers get me?
lsXml = lsXml & "<TO>" & LsVw.SelectedItem & "</TO>"
-
Re: sending sms with listview and checkbox in listview
no getting u bro ..
u chose 3 cust ok
then u click snd buttn but it does not as text2 is empty rit ?
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
no getting u bro ..
u chose 3 cust ok
then u click snd buttn but it does not as text2 is empty rit ?
text 2 is only to send to 1 phone number thats it.
i need the option to send to acouple
-
Re: sending sms with listview and checkbox in listview
give me the code to fill the text box with one cust u select
-
Re: sending sms with listview and checkbox in listview
which code?
i uploaded here all the codes
-
Re: sending sms with listview and checkbox in listview
u send me wrong form there is no list its picture box no rit code .... i could have told u before but ignored it
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
u send me wrong form there is no list its picture box no rit code .... i could have told u before but ignored it
some thing is missing here
lsXml = lsXml & "<TO>" & LsVw.SelectedItem & "</TO>"
i need to put something instead of the LsVw.SelectedItem
-
1 Attachment(s)
Re: sending sms with listview and checkbox in listview
something like this
Code:
Dim i As Integer
Dim PhoneNumbers As String
Dim PhoneArray() As String
For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems(i).Selected = True Then
PhoneNumbers = PhoneNumbers & ListView1.ListItems(i).SubItems(1) & ","
End If
Next
PhoneArray = Split(PhoneNumbers, ",")
For i = 0 To UBound(PhoneArray) - 1
'Send Code... blah blah "mailto:" & PhoneArray(i) 'i will put example as debug.print
Debug.Print "mailto:" & PhoneArray(i)
Next
i attached a quick small example of listview
-
Re: sending sms with listview and checkbox in listview
i hope now u get the listview method :D
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
this?
It looks like they allow multiple <TO> tags.
Have you tried that function that I posted ?
vb Code:
Private Function getSelectedNums() As String
Dim temp As String
temp = ""
Dim i As Long
For i = 1 To ListView1.ListItems.Count '~~~ Loop through the listview
If ListView1.ListItems(i).Checked = True Then '~~~ if an item is checked
temp = temp & "<TO>" & ListView1.ListItems(i).SubItems(1) & "</TO>" & vbCrLf '~~~ enclose the number in "<TO>" tags
End If
Next
getSelectedNums = temp '~~~ return it
End Function
Usage:
Code:
'....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & getSelectedNums()
lsXml = lsXml & "</DEST_LIST></BODY>"
'...
:wave:
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
It looks like they allow multiple <TO> tags.
Have you tried that function that I posted ?
vb Code:
Private Function getSelectedNums() As String
Dim temp As String
temp = ""
Dim i As Long
For i = 1 To ListView1.ListItems.Count '~~~ Loop through the listview
If ListView1.ListItems(i).Checked = True Then '~~~ if an item is checked
temp = temp & "<TO>" & ListView1.ListItems(i).SubItems(1) & "</TO>" & vbCrLf '~~~ enclose the number in "<TO>" tags
End If
Next
getSelectedNums = temp '~~~ return it
End Function
Usage:
Code:
'....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & getSelectedNums()
lsXml = lsXml & "</DEST_LIST></BODY>"
'...
:wave:
where do i put this code?
in the bttnsend?
i replaced this - sXml = lsXml & "<TO>" & Text2 & "</TO>" - for this - lsXml = lsXml & getSelectedNums()
but its not working
-
Re: sending sms with listview and checkbox in listview
"Not working" doesn't helps us to solve your issue !
You have to explain what have you tried and what happened.
:wave:
-
Re: sending sms with listview and checkbox in listview
i put this - sXml = lsXml & "<TO>" & getSelectedNums() & "</TO>"
it dosnt give me any error
and its not sending the sms to the specific phone number that i choose from the listview
-
Re: sending sms with listview and checkbox in listview
tnx for everybody who tried to helpe me
but theres sometimes you cant do nothing.
useruseronline can you send me the code with the listbox plz?
the full code yes?
lsets say i want to send the sms through the listbox
how do i do that?
-
Re: sending sms with listview and checkbox in listview
I thought you told us your code was working and you could send sms to one number at a time.. If akhileshbc's code not working then why don't you use the example I gave you just loop throught the phone numbers selected and send one by one like you used to! We gave u anwsers and u still say its not working! The only change that you might need is to add a pause between each time you send an sms like the "sleep api" or timer control
Sleep 500
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
Max187Boucher
I thought you told us your code was working and you could send sms to one number at a time.. If akhileshbc's code not working then why don't you use the example I gave you just loop throught the phone numbers selected and send one by one like you used to! We gave u anwsers and u still say its not working! The only change that you might need is to add a pause between each time you send an sms like the "sleep api" or timer control
Sleep 500
its working if i send sms 1 by one
but what if i want to send to all customers or to a few cutomers?
i gave up on the listview beacuse it didnt work
do you have an idea how do i send to all with the listbox?
-
Re: sending sms with listview and checkbox in listview
ya u can send it by listbox but not by list view , ok ?
-
Re: sending sms with listview and checkbox in listview
ok
show me the code please
-
1 Attachment(s)
Re: sending sms with listview and checkbox in listview
-
Re: sending sms with listview and checkbox in listview
look this code
sXml = lsXml & "<TO>" & Text2 & "</TO>"
what do i write intsead of text 2?
this is the sending code bro
-
Re: sending sms with listview and checkbox in listview
-
Re: sending sms with listview and checkbox in listview
-
Re: sending sms with listview and checkbox in listview
Do one thing, replace that line with this:
Code:
sXml = lsXml & "<TO>number1</TO>"
sXml = lsXml & "<TO>number2</TO>"
In the above two lines, replace "number1" and "number2" with any 2 mobile numbers to test.
See if the message was sent to those two numbers. If not, you could conclude that your API provider is preventing multiple recipients.
:wave:
-
Re: sending sms with listview and checkbox in listview
dont put this in the place where i write to put code
sXml = lsXml & "<TO>" & Text2 & "</TO>"
place this code in the send button where u want to send the number
sXml = lsXml & "<TO>" & list2.text & "</TO>"
then put this code in my button
nameofursendbutton_click
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
Do one thing, replace that line with this:
Code:
sXml = lsXml & "<TO>number1</TO>"
sXml = lsXml & "<TO>number2</TO>"
In the above two lines, replace "number1" and "number2" with any 2 mobile numbers to test.
See if the message was sent to those two numbers. If not, you could conclude that your API provider is preventing multiple recipients.
:wave:
yes its sending