Play MP3 with Nero in MS Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rbhulai
    New Member
    • Mar 2008
    • 2

    Play MP3 with Nero in MS Access

    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?
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    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...

    Nic;o)

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      If you do not want to be bothered with Hyperlinks, then:
      1. 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
      2. 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

      Working...