魔方网表 让信息化更简单

 找回密码
 注册
查看: 2002|回复: 0

一个可以让Excel、Access等程序播放声音文件的函数(只能放WAV文件)

[复制链接]
lnxxnchzyl 发表于 2009-10-19 09:57:53 | 显示全部楼层 |阅读模式
一个可以让Excel、Access等程序播放声音文件的函数(只能放WAV文件)
会让你的系统或者表格别具一格哦 :)

使用方法:=PlaySound("声音文件名.WAV")  (声音文件必须含路径和扩展名)
          =PlaySound(A1)   (A1单元格中存放声音文件名)

Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" _
(ByVal filename As String, ByVal snd_async As Long) As Long
Function PlaySound(sWavFile As String)
If apisndPlaySound(sWavFile, 1) = 0 Then
MsgBox "The Sound Did Not Play!"
End If
End Function
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|魔方软件 ( 京ICP备08008787号 )

京公网安备 11010702001722号

GMT+8, 2024-5-5 05:06 , Processed in 0.054993 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表