Get Phone Number
Hi! I'm a newby in modem programming, i'd like knowing if it is possibile detect when my modem is connected to internet and wich number it has called. Thanks a lot Manuel
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Validating STD && Phone Number [Indian Phone]
Hi folks,
Iam trying to validate STD and Phone number using a maskedit. Here are the conditions:
1. If the user starts to key in the STD part, he cannot leave it incomplete (meaning 1st 4 chars including 0) and inbetween jump to phone part. Even using mouse. Note:Initial zero would be part of mask literal.
2. If the user starts to key in the phone part, he cannot leave it incomplete (meaning 1st 7 chars ) and inbetween jump to STD part. Even using mouse.
3. In both the above cases he can switch if he deletes the whole entry (meaning if the field is empty)
4. There should be no blanks inbetween the digits in either of the field.
5. If the STD part is entered the phone number should necessarily be entered. However it is not compulsory to enter the STD part if phone part is filled up (meaning STD & phone can together be empty or only STD can be empty, but if STD is filled up it is compulsory that phone should be filled)
Thus in nutshell we need to check the correctness and completeness of the data entered.
We were able to accomplish it, but a small problem has crept in. Mask edit has a default behaviour to push chars to left if right side of "-" is filled up b'coz of which when we first fill up the phone number and then enter even one char of STD part the data of phone part is shifted to STD part thereby creating an incompleteness in phone part and generating "phone incomplete error".
CODE:
VB Code:
'THIS CODE IS INTENDED TO ENSURE THAT :'1.FIRST 4 DIGITS OF STD CODE ARE FILLED UP WITHOUT ANY BLANKS'2.FIRST 7 DIGITS OF PH NO. ARE FILLED UP WITHOUT ANY BLANKS'3.IF THE USER STARTS ENTERING THE STD CODE THEN HE SHOULD'COMPLETE THE SAME BEFORE JUMPING TO THE PHONE NUMBER'PART i.e. HE CANNOT LEAVE THE STD PART INCOMPLETE'4. SIMILARLY IF THE USER STARTS ENTERING THE PHONE NO. THEN HE SHOULD'COMPLETE THE SAME BEFORE JUMPING TO THE STD PART'PART i.e. HE CANNOT LEAVE THE PHONE PART INCOMPLETE'NAME THE MASKEDIT CONTROL AS MED1'COPY THE BELOW CODE INTO THE DECLARATIONS SECTION Dim STDValueAtKeyDown As Boolean, phoneValueAtKeyDown As BooleanDim myArr() As StringDim prevVal As StringDim phoneComplete As BooleanDim stdComplete As BooleanDim errLocated As BooleanDim selPoint As Integer Private Sub Form_Load() MED1.AllowPrompt = True MED1.Mask = "0####-########"End Sub Private Sub MaskEdBox1_Change() End Sub Private Sub MED1_GotFocus() Clipboard.ClearEnd Sub Private Sub MED1_KeyDown(KeyCode As Integer, Shift As Integer) 'Label1.Caption = "keydown" myArr = Split(MED1.Text, "-") If Mid(myArr(0), 1, 4) = "0___" Then STDValueAtKeyDown = False Else STDValueAtKeyDown = True If Mid(myArr(1), 1, 7) = "_______" Then phoneValueAtKeyDown = False Else: phoneValueAtKeyDown = True End Sub Private Sub MED1_KeyPress(KeyAscii As Integer) prevVal = MED1.Text selPoint = Me.MED1.SelStartEnd Sub Private Sub MED1_KeyUp(KeyCode As Integer, Shift As Integer) Dim n1 As Byte, n2 As Byte Dim STDvalueAtKeyUp As Boolean Dim phoneValueAtKeyUp As Boolean If KeyCode >= 47 And KeyCode <= 58 Then Me.MED1.Text = ShiftString(Chr(KeyCode)) Me.MED1.SelStart = selPoint + 1 End If If KeyCode = vbKeyLeft Or KeyCode = vbKeyRight Or KeyCode = vbKeyBack Then Exit Sub myArr = Split(MED1.Text, "-") If Mid(myArr(0), 1, 4) = "0___" Then STDvalueAtKeyUp = False Else STDvalueAtKeyUp = True If Mid(myArr(1), 1, 7) = "_______" Then phoneValueAtKeyUp = False Else: phoneValueAtKeyUp = True stdComplete = True phoneComplete = True Call STDCompleteCheck Call PhoneCompleteCheck' MsgBox "STD - " & STDValueAtKeyDown & ": STD complete - " & stdComplete & " Phone - " & phoneValueAtKeyDown & " : Phone complete - " & phoneComplete If STDValueAtKeyDown = False Then If phoneValueAtKeyDown = False Then Call STDCorrectCheck Call PhoneCorrectCheck If errLocated Then Exit Sub End IfEnd If If STDValueAtKeyDown = True Then If stdComplete = False Then If phoneValueAtKeyUp = True Then MsgBox "It appears that you have not completed entering the STD Code." _ & vbCrLf & "Please complete the same before proceeding further ", vbOKOnly + vbInformation MED1.Text = prevVal Exit Sub Call STDCorrectCheck If errLocated Then Exit Sub Else Call STDCorrectCheck End If Else If phoneValueAtKeyUp = True Then Call PhoneCorrectCheck End If Call STDCorrectCheck End IfElse If phoneValueAtKeyDown = True Then If phoneComplete = False Then If STDvalueAtKeyUp = True Then MsgBox "It appears that you have not completed entering the Phone no." _ & vbcrfl & "Please complete the same before proceeding further ", vbOKOnly + vbInformation MED1.Text = prevVal Exit Sub Else Call PhoneCorrectCheck End If Else Call PhoneCorrectCheck End If End IfEnd IfEnd SubPrivate Function STDCorrectCheck() As StringDim i As Integer, m As Integer, n As Integer, location As Integer For n = 5 To 2 Step -1 If IsNumeric(Mid(myArr(0), n, 1)) Then location = n - 1 Exit For End If Next n If location = 1 Then Exit Function For m = 2 To location If Not IsNumeric(Mid(myArr(0), m, 1)) Then MsgBox "The STD code is incorrectly being entered. Please correct it.", vbOKOnly + vbInformation MED1.Text = prevVal MED1.SelStart = m - 1 Exit Function End If Next mEnd FunctionPrivate Function STDCompleteCheck() As StringFor i = 2 To 4 If Not IsNumeric(Mid(myArr(0), i, 1)) Then stdComplete = False Exit For End If NextEnd FunctionPrivate Sub PhoneCorrectCheck() Dim i As Integer, m As Integer, n As Integer, location As Integer For n = Len(myArr(1)) To 1 Step -1 If IsNumeric(Mid(myArr(1), n, 1)) Then location = n - 1 Exit For End If Next n For m = 1 To location If Not IsNumeric(Mid(myArr(1), m, 1)) Then errLocated = True MsgBox "The phone number is being incorrectly entered." _ & vbCrLf & "Please re-enter correctly.", vbOKOnly + vbInformation MED1.Text = prevVal MED1.SelStart = m + 5 Exit Sub End If Next m End SubPrivate Sub PhoneCompleteCheck() For i = 1 To 7 If Not IsNumeric(Mid(myArr(1), i, 1)) Then phoneComplete = False Exit Sub End If Next phoneComplete = TrueEnd Sub Private Function ShiftString(ByVal char As String) As String ShiftString = Mid(prevVal, 1, selPoint) & char ShiftString = ShiftString & Mid(prevVal, selPoint + 2, Len(prevVal) - (selPoint + 1))End Function
All solutions or/and improvements are welcome.
Thanks in advance
Phone Number
I want to format a phone number via the onChange event of a text box. Basically what I am looking for is a user to press three numbers "123" and have it go to (123) with a space on the end, then type in 3 more numbers 123 and have it go (123) 456-, etc.
Thanks!
Phone Number
I am trying to check and make sure that the User has entered a proper format Phone number
555-555-5555
or
555-5555
i tried to use the
Code:
textbox.text<>format(textbox.text,"###-####)
and
Code:
textbox.text<>format(textbox.text,"###-###-####)
but if i enter 1234-55
it says that it is valid. How can i make sure that all the pos-holders are filled
thanks
Phone Number
I need help. I have developed a aplication using TAPI that can detect dialing some number.
Here's my problem. I cant detect number which is being called and I pause that call to ask users does he/she wants to allow or stop that call
if I dont want to allow calling of that number.
Please help me.
Thanks in advance,
Mario
Phone Number Parsing
I am trying to write a simple program that will parse phone numbers from a memory dump. The numbers are in different formats:
555-555-5555 or
555 555 5555 or
5555555555.
I can grab the whole line but am having problems trimming the rest of the characters.
Any suggestions?
Fax Printer - Phone Number
I have figured out how to change the Word printer to the fax printer from my VB app, but does anyone know how I can tell the fax printer the phone number to fax to from my app without the user having to type it in?
Identify Phone Number
Is there a way to identify phone number using VB
So if someone will call me I could know his number
Thanks in advance!
Phone Number To Letters
if i wanted to make a program that would tell someone all the possible letter combinations a person can have with their phone number how would i go about doing it efficiently. so basically if someone's number is 234-5678 i want to tell as many letter combinations they can get that if they convert that to the letter on the phone number. oh and this is writing to a file.
How To Search By Phone Number?
Hello Everyone
Here is the situation. I am using VB 6, and MS Access 2003. I have run into a bit of a problem, and want to get some other opinions on the issue.
My app tracks employees and customers. The application needs to be able to search for employees and customers by their phone numbers. The only catch is that the app needs to be user friendly. This means I can not force the end users to enter a phone number in a specific format. They need to be able to user their own formatting as they desire. I also can not impose any formatting constraints because the phone number field needs to allow for international phone numbers to be entered.
Phone numbers can be entered in any of the following ways, and also ways which are not listed below.
1-888-888-8888
1 (888) 888-8888
18888888888
1 888-888-8888
+1 888 888-8888
etc……
Now when my end user searches the DB for a phone number my app strips all formatting from the phone number so all I end up with is a string of numbers. The problem is in the database. Since the database will store the phone number in any type of format when I search using the LIKE command I get no results, or missing results. I had though about adding another field to the DB, something like n_phone_num, which will match vc_phone_num, just with out any of the formatting. However this will be a big undertaking. To do this I will need to re-program all CRUD (Create, Remove,Update,Delete) functions.
What I was also thinking to do is to select all records, then filter the record set results by removing all formatting, so that I also end up with a numeric string of number with no formatting. This way I could match the number string from my app, to the number string filtered from the DB. Can this be done?!?!?!
I am hoping someone has solved this problem before and can shed some light on this problem for me.
Thanks in advance.
Validating Phone Number
hi
how to validate the phone number in vb6.0
the validate should be e.g. 555-555-5555 or 5555555555 in this form
can any one plz help me out its very urgent.
Thanking you
asra.
Text Phone With 0 Being First Number
I've got a textbox and i want to add a phone number to it starting in 0. This will also be saved into a .mdb database. Currently it drops the 0. HOw can i get this to stay on there?
Dialing A Phone Number
Hello
Well.. I have two buttons in my app, and a textbox. I nedd that command1 dial the number in the textbox, and command2 hangup
I also want to be able to listen the other party on my speakers, that is, my speakers should behave as the ear phone of a phone..
Does anyone have an example code??
thanks a lot
Phone Number Validation
Hail,
Would it be possible to create an application that dials into a predetermined list of phone numbers and can identify the following:
If there's no answer
If there's a busy signal
If I reached an IVR
If I reach dead air...
The point would be to validate certain numbers' status and knowing one is in trouble, right now we have to wait for customer complaints...
I know you can dial phone numbers from VB apps but can it return a code depending on what happens on the other end?
Phailak
Phone Number Validate
Hello people,
I am in the process of writing my major Yr 12 visual basic case study, and have run into a little problem. I am trying to check that when the txtPhone_Num field loses focus a sub will check 1 digit at a time to make sure that only numbers have been entered.
Anyway this is what i've got so far:
Private Sub txtPhone_Num_LostFocus()
If txtPhone_Num.Text <> "" Then
Phone_NumValidate
End If
End Sub
Private Sub Phone_NumValidate()
Dim i As Integer, char As String * 1, sentence As String
sentence = txtPhone_Num
i = 1
For i = 1 To Len(sentence)
char = Mid(sentence, i, 1)
If char <> "1" Or "2" Or "3" Or "4" Or "5" Or "6" Or "7" Or "8" Or "9" Or "0" Then
intpress = MsgBox("Please enter a valid phone number containing numbers only", vbExclamation + vbOKOnly, "Error!")
txtPhone_Num = ""
txtPhone_Num.SetFocus
Exit Sub
End If
i = i + 1
Next i
End Sub
Anyway the problem is that the error comes up every time, even when i do just put numbers in. Can anyone their help?
Thanks.[php]
Dialing A Phone Number
I am looking for a way to dial for a voice call but I can't use the MScomm32 ActiveX.
Can some one help?
if possible with no API.
Validating A Phone Number
hi, i want to be able to let the user enter a phone number and if the first three digits are 412, they will be offered free delivery... how would i write code to check to see if the first three digits are 412? also, how could i determine the phone number was complete?
Validating Us Phone Number In Vb6.0
hi
how to validate the phone number in vb6.0
the validate should be e.g. 555-555-5555 or 5555555555 in this form
can any one plz help me out its very urgent.
Thanking you
asra.
Edit [sp!ke]: Moved to VB 6 Forums from VB.NET forums.
Edited by - sp!ke on 8/1/2007 6:40:52 AM
How To Search By Phone Number?
Hello Everyone
Here is the situation. I am using VB 6, and MS Access 2003. I have run into a bit of a problem, and want to get some other opinions on the issue.
My app tracks employees and customers. The application needs to be able to search for employees and customers by their phone numbers. The only catch is that the app needs to be user friendly. This means I can not force the end users to enter a phone number in a specific format. They need to be able to user their own formatting as they desire. I also can not impose any formatting constraints because the phone number field needs to allow for international phone numbers to be entered.
Phone numbers can be entered in any of the following ways, and also ways which are not listed below.
1-888-888-8888
1 (888) 888-8888
18888888888
1 888-888-8888
+1 888 888-8888
etc……
Now when my end user searches the DB for a phone number my app strips all formatting from the phone number so all I end up with is a string of numbers. The problem is in the database. Since the database will store the phone number in any type of format when I search using the LIKE command I get no results, or missing results. I had though about adding another field to the DB, something like n_phone_num, which will match vc_phone_num, just with out any of the formatting. However this will be a big undertaking. To do this I will need to re-program all CRUD (Create, Remove,Update,Delete) functions.
What I was also thinking to do is to select all records, then filter the record set results by removing all formatting, so that I also end up with a numeric string of number with no formatting. This way I could match the number string from my app, to the number string filtered from the DB. Can this be done?!?!?!
I am hoping someone has solved this problem before and can shed some light on this problem for me.
Thanks in advance.
Phone Number Dialing
Hi
I have to dial a phone number through VB code Please Help
Thanks in advance
Regards
Nit
How To Validate A Phone Number
I have this code for checking to see if a phone
number is entered as numbers but it is not working
could someone tell me why?
If isempty(Phone) then
PhoneIsOkay = false
PageIsOkay = false
else
If len(Phone)<>8then
PhoneIsOkay = false
PageIsOkay = false
i = 1
While i < 8 'there are eight spaces that you want to check
Select Case i
Case 1,2,3 ' the positions in the string that should be numbers
If Not IsNumeric(mid(Phone,i,1)) then 'Check the format
PageIsOkay = false
End If
Case 4 'check that middle for a dash
If IsNumberic(mid(Phone, i, 1)) then
PageIsOkay =false
End If
Case 5,6,7 ' the positions in the string that should be numbers
If Not IsNumeric(mid(Phone,i,1)) then 'Check the format
PageIsOkay = false
End If
End Select
i= i+1
Wend
End If
End If
Thanks
Louise
Getting A Phone Number To Equal A Timezone
I am trying to create a excel sheet with a way to get the time zone in one celll by entering a area code and phone number.
At this time I have been unable to get it to work
Any help woulfd be great
Thanks
Boakie
Formatting For A Phone Number In A Report
Does anyone know what the formating command is to format a phone number i need the actual command like format(phone, format) or something because the phone number is displayed with other things so it can't be field specific, thanks fo any help with this
Open Phone Number From Database
Hi there, i've attached a VB output. Please help me solve how to programme the code so that when i click the name, it'll giv me the phone number of the particular person. please send as soon as possible. Thank fo being a good human being.
Phone Number From Text File
Hi,
i have "01524 218421" stored in a text file. When i try to read it however it reads "1524" and then the next line as "218421" when it should be reading the following line.
How can I fix this to read it all as one and with the first zero?
Many thanks
Nick Swan
Using The Modem To Dial A Phone Number
Hello. I need to know how to access the modem through a program I write. What I need to do is make an object which will call a phone number through the modem in the computer... This would be all fine and dandy except for one thing... I don't have any idea about how to do it! Any ideas would be greatly appreciated and if someone out there has an object that does that... well... I wouldn't mind getting in touch with you!
Another thing: The idea is that the object can call a beeper or even send a SMS message to a GSM phone... now the SMS idea is stretcing it I know... I doubt that there is any "universal way" of sending a SMS message from a computer. At least you can't just call the phone. So... if anyone out there knows anything about this... his/her help would be greatly appreciated!
I'm gonna use Java for the project but this could also be written in any other language. Maybe a COM object would suit best???
Thanks a lot in advance!
Stebbi
p.s. I don't know which forum I should post this in so I'll post it in a few... hope you forgive me for that!
An elephant is a mouse with an operating system
Format Phone Number String
I need to format a telephone number string like ###-###-####.
The problem is that th string can be of any length, from 1 character to all 10 characters. If the string is less that 10 characters, then the remaining characters need to be _ (underscores). (I have already taken care of validating the string to make sure it's a valid phone number.)
I tried:
strPhone = Left(strPhone & "__________", 10) 'Adds 10 _'s and then takes the leftmost 10 characters
and then using Format to add the dashes, but I don't know that specifier for a non-numeric character.
Is there a function in VB that will allow me to insert a character into a string at a certain place?
Crystal Reports Phone Number Format
i need a format for telephone numbers. i see other ones e.g. date/time/currency etc., but i cant see either a phone number one or a custom one where i could make my own mask.
my data comes in as 1234567890 and i need it formatted like
(123) 456-7890
thanks.
Format(text1.text) For A Phone Number
We never discussed the format() function in class before but I remember seeing a program where the textbox automatically converted 8005551212 to (800)555-1212. I know they used the format function but I cant get it working. What is the proper syntax.
Textbox Format To Current And Phone Number
In VB6 using visual basic code
how do I set the input format to currency (to display dollar signs) and a textbox to a phone number
ex: 602-555-5555
999-999-9999 to display the two - dashes when typing a number
and to be saved with the dashes or be able to retrieve the numbers with the text box displaying the value with dashes
Thanks for your help
And you happen to know how to set a text box to display capitalized letters only like in the state box AZ but
Thanks ,
Zoila
Phone Number Text Easeir Way Than This Code I Did???
This is my First real attempts at string manipulation like this so be kind
Cause Im really proud just getting it to work for my first try LOL
Anyway, I know theres got to be an easier way... even if this isnt clean it works...
This takes the type text ir PHONENUMBER as it is typed into a Textbox
and places () around area code and - well as you can see in the code its tested and it works but can it be done easier???
VB Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)Dim str1 As StringDim str2 As StringDim str3 As StringDim str4 As String If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0 '0 is Ascii Null End If If Len(Text1.Text) = 3 Then str1 = Text1.Text str1 = "(" & Left(str1, 3) & ")" Text1.Text = str1 Text1.SelStart = 5 End If If Len(Text1.Text) = 8 Then str1 = Text1.Text str2 = Left(str1, 5) str3 = Right(str1, 3) str1 = str2 & "-" & str3 & "-" Text1.Text = str1 Text1.SelStart = 10 End If If Len(Text1.Text) = 13 Then Text2.SetFocus End IfEnd Sub
vbMarkO
Dialing A Phone Number With Cable Modem
Hi, I am writing an email check program and I want it to call my pager when certain emails has arrived. But the problem is I am using a cable modem and I have no idea how to make it dial my pager number. Please if anybody know of any way to do this?
Phone Number And Postal Code Formating
Add two string fields to the table that contains the country. Store the format string for the phone number in one (in this example I've named it fsPhoneNumber) and the format string for the postal code in the other. (BTW the format string for the phone number is (###)###-#### but I don't know how to easily add the space needed in the postal code format string.) When you know the country use the database format string in the format expression like MsgBox Format(MyPhoneNumber, fsPhoneNumber).
------------------
Marty
[This message has been edited by MartinLiss (edited 11-16-1999).]
Ensure A Phone Number Is Added To A Field
A project I am creating requires a phone number to be added (11 digits no spaces) how can I make sure that all 11 digits are added and that the user does not enter any number (eg all zeros) is there some sort of filter or mask that can be used?
thanks
Detect Which Phone Number Modem Is Dialing And Optional Hangup
Hello. I have seen there are many people who know the Comm Control and Modem related topics very well.
I want to write a program that will catch when windows try to dial
a phone number.
If this phone number is a specific one then let it dial else
hangup the modem.
This would restrict users only to dial a specific number with their modems.
Do you know how to achieve this ? I have no idea about Comm Control but know VB well.
Does the Comm Control intercept the commands sended to the modem from ALL other applications ?
I could make a timer and in the timer function get the input of the comm control and do a Instr("ATDT") and then get the phone number.
Correct me if i am wrong
thanks!
Detect Which Phone Number Modem Is Dialing And Optional Hangup
want to write a program that will catch when windows try to dial
a phone number.
If this phone number is a specific one then let it dial else
hangup the modem.
This would restrict users only to dial a specific number with their modems.
Do you know how to achieve this ? I have no idea about Comm Control but know VB well.
Does the Comm Control intercept the commands sended to the modem from ALL other applications ?
I could make a timer and in the timer function get the input of the comm control and do a Instr("ATDT" ) and then get the phone number.
Correct me if i am wrong
thanks!
Need To Validate A Phone Number Field Which Will Be Called From An Access Database
I am building a beginner's database for school. I used VB to build a form out of an Access database. My assignment is to validate and automatically edit the phone number field to store the input in a specific format. I know that the logical thing to do would be to lock the input format in the properties, but the assignment is to remove the "1", parentheses, and dashes, if there are any, then display the number in this format...(xxx)xxx-xxxx, regardless of whether the user enters 1-xxx-xxxx, 1xxxxxxx, 1 xxx xxxx, 1(xxx)xxx-xxxx, (xxx)xxx-xxxx, or what have you. Is there a chunk o code out there? Thank you for being here to read these strings and attempt to help, by the way. It is admirable that some have come far enough in their learning and are still motivated to take time to help others....hope to be helping others one day myself...Peace, friends
P.S. Attached is the little database that I am using to build the form. It is in Access 97 format because the learning edition of VB6 will not accept anything else.
Pc To Phone
hi
i was wondering if there was any small vb projects out there to show you how to start a pc to phone project?and also if it can be done in vb and what would you need? thanks...
Phone And VB !!!!!
hi all ,
i want to know that how i can programs with vb to handle my modem.
my teacher gave me a project for our school :
he said that i should write a program that runs on a computer at the school (with modem) and every one that phones to that modem , the program should automatically respond to the caller, then the program asks the user to gave its a student ID and then the program reads the grade for each lesson of that student.
the callers have not computer!!! only the school have computer with modem.
if any one has a source or could help me i will be so thankfull.
good luck .
AIM Phone
bet there is a code out here for Visaul Basic that will make it have a phone next to your sign on screen name? Has any one seen the code for that if so please post. I know theres one but that thingy don't even sign on so any one with anything like code any thing please post. Thanks again
Phone
i want code send to the phone message
please but a example
Phone
Hello...
I have 2 questions:
1. How to make your computer functions as an answering machine without using a 3rd party control.
2. Is it possible to use ur computer as ur telephone. I mean the voice modem could be attached by speaker & microphone. So may be, instead of using a telephone u could direct it to the computer? Is it possible? Any sample code... if possible... please.
Thanks.
|