如果用VBA代码播放WAV声音文件,可以用下面的代码:
Private Declare Function sndPlaySound32 _Lib "winmm.dll" _Alias "sndPlaySoundA" ( _ByVal lpszSoundName As String, _ByVal uFlags As Long) As Long
Sub PlayWavFile()sndPlaySound32 "C:\Windows\Media\ding.wav", 0&End Sub
运行上述代码将播放“C:\Windows\Media”文件夹中的ding.wav声音文件。
转载声明:本站发布文章及版权归原作者所有,转载本站文章请注明文章来源!