Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default stopping Windows Media Player using VBA

I've been trying to write some code which will start playing an audio file and then stop after a certain number of seconds. I've tried this:-

sub testcode ()

Dim wmp as WindowsMediaPlayer

Set wmp = New WindowsMediaPlayer

wmp.URL = "C:\audio\test.mp3"

wmp openPlayer (wmp.URL)

Application.Wait Now() + TimeSerial(0, 0, 10)

wmp.Controls.stop

End Sub

It opens the player ok and plays the file but then it doesn't stop after 10 sec.

wmp.playState tells me it is stopped - but the player keeps going. Is wmp.Controls.stop the wrong command?

I'm not too experienced with this sort of thing so I may be making a really silly mistake. Can anyone tell me what it is?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
windows media player commands teepee[_3_] Excel Discussion (Misc queries) 5 November 1st 08 11:58 PM
Close Windows Media Player Cordell Excel Discussion (Misc queries) 1 January 30th 07 04:43 AM
Media Player versus Windows Media Player teepee[_4_] Excel Programming 6 October 15th 05 06:16 PM
Media Player versus Windows Media Player teepee Excel Discussion (Misc queries) 1 October 14th 05 02:25 AM
Excel windows media player links JohnNews Excel Programming 1 October 8th 04 03:23 PM


All times are GMT +1. The time now is 02:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"