DISCOVER
×
Loading ...

How to Make Telephone Calls With Visual Basic

Updated July 20, 2017

Having the knowledge of how to make telephone calls from a Microsoft Visual Basic.NET (VB.NET) application can save you time if you need to make calls continuously. VB.NET is a computer programming language used to create mobile, Web and desktop applications. Making telephone calls from VB.NET can be accomplished using the Telephony Application Programming Interface (TAPI). TAPI gives the programmers the layers needed to access the Microsoft Telephony DLLs (dynamic link libraries). Telephony integrates computers with devices such as cameras and Internet networks.

Loading ...

Start Microsoft Visual Basic Express, click "New Project..." on the left pane of your screen and select "Windows Forms Application." Click "OK."

Double-click "Button" on the "Toolbox" to add a new button. Double-click "Label" to add a label. Add a second label using the same process. Double-click "TextBox" to add a text box.

Double-click "Button1" to open the "Form1.vb"module. Copy and paste the following in the very first line of the module:

Imports System.Windows.Forms

Copy and paste the following to declare the TAPI32 DLL under "Public Class Form1" but above the "Button1_Click" procedure:

The "Button1_Click" procedure was created when you double-clicked "Button1" on your Form.

Copy and paste the following inside the "Button1_Click" procedure to create your variables:

The "Button1_Click" procedure was created when you double-clicked "Button1" on your Form.

Copy and paste the following to get the phone number entered in the text box and call it:

phoneNum = Trim(TextBox1.Text)

Copy and paste the following to check for errors:

End Class

Press "F5" to run your program, then enter a phone number in the text box and click "Button1."

Loading ...

Things You'll Need

  • Microsoft Visual Basic Express

About the Author

Jaime Avelar is a professional writer whose programming articles appear on various websites. He has been a software programmer since 2000. Avelar holds a Master of Science in information systems from the University of Texas at Arlington.

Loading ...