I'm trying to play a mp3- file in MS Access VBA. I already finda script that opens mine music player NERO. But how could I play a mp3 file?
Play MP3 with Nero in MS Access
Collapse
X
-
If you do not want to be bothered with Hyperlinks, then:- In a Stand Code Module, Copy and Paste the following Declaration:
Code:Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _ ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
- Play the *.mp3 File, it will be Opened by the Default Appplication registered to play *.mp3s:
Code:Dim strFileName As String Dim strAction As String Dim lngRetVal As Long 'Edit this, Absolute Path to *.mp3 File: strFileName = "C:\<Some Directory>\<Some File.mp3>" ' the file you want to Open. lngRetVal = ShellExecute(0, "OPEN", strFileName, "", "", 0)
Comment
- In a Stand Code Module, Copy and Paste the following Declaration:
Comment