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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

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.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.