利用API可以直接拨号
2006-02-27 11:55:54 来源:WEB开发网核心提示:声明:PRivateDeclareFunctiontapiRequestMakeCallLib"TAPI32.DLL"(ByValDestAddr$,ByValAppNameAsString,ByValCalledPartyAsString,ByValCommentAsString)AsLong例子
声明:
PRivateDeclareFunctiontapiRequestMakeCallLib"TAPI32.DLL" (ByValDestAddr$,ByValAppNameAsString, ByValCalledPartyAsString,ByValCommentAsString)AsLong
例子:
PublicSubCallPhone(NumberAsString,NameAsString)
DimlResAsLong
If(Trim(Number)="")Then
ExitSub
EndIf
If(MsgBox("Abouttocall"&Trim(Name) &"atphonenumber"&Trim(Number)&vbCrLf&"Doit?", vbYesNo,App.Title)=vbYes)Then
lRes=tapiRequestMakeCall(Trim(Number),App.Title,Trim(Name),"")
Debug.PrintNow;"CallPhone->tapiRequestMakeCallResultcode=";lRes
EndIf
EndSub
还有一种方法是:
PhoneNumber$="(123)456-7890"
Open"COM2:"ForOutputAs#1'orCOM1
Print#1,"ATDT"&PhoneNumber$&Chr$(13)
Close#1
当然,该方法只适合小型的应用。->
PRivateDeclareFunctiontapiRequestMakeCallLib"TAPI32.DLL" (ByValDestAddr$,ByValAppNameAsString, ByValCalledPartyAsString,ByValCommentAsString)AsLong
例子:
PublicSubCallPhone(NumberAsString,NameAsString)
DimlResAsLong
If(Trim(Number)="")Then
ExitSub
EndIf
If(MsgBox("Abouttocall"&Trim(Name) &"atphonenumber"&Trim(Number)&vbCrLf&"Doit?", vbYesNo,App.Title)=vbYes)Then
lRes=tapiRequestMakeCall(Trim(Number),App.Title,Trim(Name),"")
Debug.PrintNow;"CallPhone->tapiRequestMakeCallResultcode=";lRes
EndIf
EndSub
还有一种方法是:
PhoneNumber$="(123)456-7890"
Open"COM2:"ForOutputAs#1'orCOM1
Print#1,"ATDT"&PhoneNumber$&Chr$(13)
Close#1
当然,该方法只适合小型的应用。->
更多精彩
赞助商链接