Windows Media Player in Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • student2
    New Member
    • Aug 2009
    • 36

    Windows Media Player in Access

    I'm trying to insert a Windows Media Player on to my Main Menu Form that would play an introductory clip to my project Db.

    I tried this my going to "More Controls" and insert the Windows Media Player. I see the Player on the form, I then went to the 'On Enter' event and placed a Macro to run a command to the location of the 'music file'. This has FAILED.

    Of course it's a guess/ trial an error I'm working this with.....since it flunked, I'm now here for expert advise.

    Thanks again!
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hi, there.
    • Control with embedded ActiveX (media player in your case) has property "Object" which returns, surprise, object of embedded ActiveX.
    • Get type of this object using TypeName() function or VBA IDE "Watch" pane.
    • Explore available methods/properties/events of the type in Object browser.
    • ????????
    • PROFIT!!!


    Kind regards,
    Fish.

    Comment

    • student2
      New Member
      • Aug 2009
      • 36

      #3
      Thanks for the reply!
      :-)

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by student2
        I'm trying to insert a Windows Media Player on to my Main Menu Form that would play an introductory clip to my project Db.

        I tried this my going to "More Controls" and insert the Windows Media Player. I see the Player on the form, I then went to the 'On Enter' event and placed a Macro to run a command to the location of the 'music file'. This has FAILED.

        Of course it's a guess/ trial an error I'm working this with.....since it flunked, I'm now here for expert advise.

        Thanks again!
        Assuming your ActiveX Control is named WindowsMediaPla yer1, to automatically Load and Play C:\Test\OhNo.wa v in Media Player when your Form is first Opened:
        Code:
        Private Sub Form_Open(Cancel As Integer)
        Const conMEDIA_FILE_TO_OPEN As String = "C:\Test\OhNo.wav"
        
        Me![WindowsMediaPlayer1].openPlayer (conMEDIA_FILE_TO_OPEN)
        End Sub

        Comment

        • student2
          New Member
          • Aug 2009
          • 36

          #5
          Thank you very much!!
          I'm going to try it :-)

          Comment

          • student2
            New Member
            • Aug 2009
            • 36

            #6
            I'm able to load the W.M.P. when the form is loaded, however, it cannot find the source, says check my path, but I've placed "C:\MyComputer\ FileName\Clip.w av", that's the location.

            Any clues?
            Thanks again!

            Comment

            • ADezii
              Recognized Expert Expert
              • Apr 2006
              • 8834

              #7
              Originally posted by student2
              I'm able to load the W.M.P. when the form is loaded, however, it cannot find the source, says check my path, but I've placed "C:\MyComputer\ FileName\Clip.w av", that's the location.

              Any clues?
              Thanks again!
              As long as the Path is valid, I see no reason why it should not work. Place the File in a Directory under the Root, as in: C:\Test, then see what happens.

              Comment

              • student2
                New Member
                • Aug 2009
                • 36

                #8
                Ok will try it thanks!

                Comment

                Working...