By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Play MP3 with Nero in MS Access

P: 2
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?
Jul 27 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 3,072
The easy way is to insert a hyperlink and select the mp3 file.
This will open the file with the default application related to the file-extension.

Having these links in a table will allow you to build an mp3 collection...

Jul 27 '08 #2

Expert 5K+
P: 8,616
If you do not want to be bothered with Hyperlinks, then:
  1. In a Stand Code Module, Copy and Paste the following Declaration:
    Expand|Select|Wrap|Line Numbers
    1. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    2. ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    3. ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  2. Play the *.mp3 File, it will be Opened by the Default Appplication registered to play *.mp3s:
    Expand|Select|Wrap|Line Numbers
    1. Dim strFileName As String
    2. Dim strAction As String
    3. Dim lngRetVal As Long
    5. 'Edit this, Absolute Path to *.mp3 File:
    6. strFileName = "C:\<Some Directory>\<Some File.mp3>"  ' the file you want to Open.
    8. lngRetVal = ShellExecute(0, "OPEN", strFileName, "", "", 0)
Jul 27 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.