返回列表 上一主題 發帖

[發問] 怎樣使excel 說出wav

回復 1# 自我感覺良好
'API Class to take care of playing the file
Public Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
                        ByVal uFlags As Long) As Long
'  修改成如下便可以了 ( PtrSafe )
'  API Class to take care of playing the file
Public Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
                        ByVal uFlags As Long) As Long

TOP

回復 3# 自我感覺良好
如果同時要在 32 / 64 位元下均能執行,請修改成:
#If VBA7 Then
    'API Class to take care of playing the file
    Public Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" _
    Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
                        ByVal uFlags As Long) As Long
#Else
    Public Declare Function sndPlaySound32 Lib "winmm.dll" _
    Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
                        ByVal uFlags As Long) As Long
#End If

TOP

        靜思自在 : 人事的艱難與琢磨,就是一種考驗。
返回列表 上一主題