This documentation is archived and is not being maintained.

Beep Function 

Sounds a tone through the computer's speaker.

Public Sub Beep()

The pitch and duration of the beep depend on your hardware and system software and therefore vary among computers.


The Beep function requires UIPermission at the SafeTopLevelWindows level, which may affect its execution in partial-trust situations. For more information, see Requesting Permissions and UIPermission Class.

This example uses the Beep function to sound a long, uninterrupted tone through the computer's speaker.

Dim I As Integer
For I = 1 To 100   ' Loop 100 times.
   Beep   ' Sound a tone.
Next I

This function is not supported.

Namespace: Microsoft.VisualBasic

Module: Interaction

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)