[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1164
  • Last Modified:

I need to Start/stop windows media player from Access through VBA - Help please

Hi there

I  am busy writing an application in Access that nedds to start and stop windows media player at certain times or after certain events.  I am currently using a batch file to start it but am unable to stop it unless the close command is used in the batch file as well.  The batch file looks like this.
    cd program files
    cd windows media player
    wmplayer.exe /fullscreen /play  c:\airit\airit.wpl

I do not want media player to stop unless I update the wpl file.  Can anyone help please
many thanks
Alan
0
caandal
Asked:
caandal
  • 2
1 Solution
 
puppydogbuddyCommented:
Although I have never used it, the vba code below (from my code library) should give you access to the properties/methods of the object via the object browser and/or intellisense, assuming that you have placed the wmp activeX control on a form. Hope this helps.

    Dim winPlayer As WindowsMediaPlayer
    Set winPlayer = wmp.Object
    With winPlayer
        'Enter code here.
    End With


0
 
caandalAuthor Commented:
Hi Puppydogbuddy

I need to be able to run an app that looks to see if media player is running and if it is to shut it down and restart it.

Thanks
Alan
0
 
puppydogbuddyCommented:
Although I have never used/tested this code, the following methods should be exposed with the object definition I gave you above.  Also this link shows how to use vba to automate media player in a  powerpoint slide show, and a lot of the code should be re-usable.  Hope it helps.
                      http://support.microsoft.com/kb/201543

IsAvailable(me.winPlayer)
isRunning(me.winPlayer)
me.winPlayer.Controls.fastForward
me.winPlayer.Controls.fastReverse
me.winPlayer.Controls.next
me.winPlayer.Controls.pause
me.winPlayer.Controls.play
me.winPlayer.Controls.playItem
me.winPlayer.Controls.stop
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now