Prev: Label printing in VB6
Next: Disabling DBCS...
From: Dennis Rose on 16 Apr 2010 17:11 Your code didn't work until I commented out the "PortOpen = false" command. Then it still didn't work for subsequent calls. What should I try next? "Jim Mack" wrote: > Dennis Rose wrote: > > Using VB5, I want to dial a phone number each time a new file > > arrives on my computer. I can dial the desired number just fine > > the first time this code is executed, but when this code is excuted > > again, the phone is "NOT" dialed. > > > > What am I doing wrong? I checked Google but didn't see a similar > > problem. Note: I could only get this to work if I commented out the > > "PortClose" command. > > > > Private Sub CallSalesperson() > > MSComm1.CommPort = 3 > > MSComm1.Settings = "9600,N,8,1" > > > > MSComm1.PortOpen = True > > MSComm1.Output = "ATDT 1-555-555-5555;" & vbCr > > > > 'MSComm1.PortOpen = False > > End Sub > > Try resetting the modem (or hanging up) just before dialing > > MSComm1.PortOpen = True > MSComm1.Output = "ATH" & vbCr > DoEvents ' and possibly a short delay > MSComm1.Output = "ATDT 1-555-555-5555;" & vbCr > DoEvents ' and possibly a short delay > MSComm1.PortOpen = False > > -- > Jim Mack > Twisted tees at http://www.cafepress.com/2050inc > "We sew confusion" > . >
From: Jim Mack on 16 Apr 2010 17:19 Dennis Rose wrote: > Your code didn't work until I commented out the "PortOpen = false" > command. Then it still didn't work for subsequent calls. > > What should I try next? If you're using the port repeatedly, why close it at all? Open the port when your program loads, close when it unloads. In between, ATH (or ATZ if necessary), with a delay, before you dial. -- Jim Mack Twisted tees at http://www.cafepress.com/2050inc "We sew confusion"
From: Dennis Rose on 16 Apr 2010 17:20 How do I send a Hang Up command? "Jim Mack" wrote: > Dennis Rose wrote: > > Using VB5, I want to dial a phone number each time a new file > > arrives on my computer. I can dial the desired number just fine > > the first time this code is executed, but when this code is excuted > > again, the phone is "NOT" dialed. > > > > What am I doing wrong? I checked Google but didn't see a similar > > problem. Note: I could only get this to work if I commented out the > > "PortClose" command. > > > > Private Sub CallSalesperson() > > MSComm1.CommPort = 3 > > MSComm1.Settings = "9600,N,8,1" > > > > MSComm1.PortOpen = True > > MSComm1.Output = "ATDT 1-555-555-5555;" & vbCr > > > > 'MSComm1.PortOpen = False > > End Sub > > Try resetting the modem (or hanging up) just before dialing > > MSComm1.PortOpen = True > MSComm1.Output = "ATH" & vbCr > DoEvents ' and possibly a short delay > MSComm1.Output = "ATDT 1-555-555-5555;" & vbCr > DoEvents ' and possibly a short delay > MSComm1.PortOpen = False > > -- > Jim Mack > Twisted tees at http://www.cafepress.com/2050inc > "We sew confusion" > . >
From: Dennis Rose on 16 Apr 2010 18:13
Dear Jim, You're the MAN!!!! I moved the portopen = true command to the first of my program and used the code below to call the Phone Num: MSComm1.Output = "ATH" & vbCr DoEvents ' and possibly a short delay MSComm1.Output = "ATDT 1-333-333-3333;" & vbCr DoEvents ' and possibly a short delay Works like a champ!!! "Jim Mack" wrote: > Dennis Rose wrote: > > Your code didn't work until I commented out the "PortOpen = false" > > command. Then it still didn't work for subsequent calls. > > > > What should I try next? > > If you're using the port repeatedly, why close it at all? Open the > port when your program loads, close when it unloads. > > In between, ATH (or ATZ if necessary), with a delay, before you dial. > > -- > Jim Mack > Twisted tees at http://www.cafepress.com/2050inc > "We sew confusion" > > . > |