📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "拨号62755372"
Height = 495
Left = 1320
TabIndex = 0
Top = 1320
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' 函数声明
Private Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" _
(ByVal DestAddr$, _
ByVal AppName As String, _
ByVal CalledParty As String, _
ByVal Comment As String _
) As Long
'电话拨号函数
'第一个参数为电话号码
'第二个参数为对方信息
Public Sub CallPhone(Number As String, Name As String)
Dim lRes As Long
' 如果电话号码为空
If (Trim(Number) = "") Then
Exit Sub
End If
' 给用户提示
If (MsgBox("About to call " & Trim(Name) & " at phone number " & Trim(Number) & vbCrLf _
& "Do it?", vbYesNo, App.Title) = vbYes) Then
' 拨号
lRes = tapiRequestMakeCall(Trim(Number), App.Title, Trim(Name), "")
Debug.Print Now; " CallPhone -> tapiRequestMakeCall Result code = "; lRes
End If
End Sub
Private Sub Command1_Click()
CallPhone 62755372, "Wang"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -