Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Controlling media player in VBA question

I want to get media player to jump back 5 seconds with a VBA macro

I tried

Dim lastpos As Long
MP.CurrentPosition = lastpos - 5

but that didn't work. It just says:

run time error 380

currentposition must be -1.0 or greater than or equal to 0.0

Anyone know how it might be done?


  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Controlling media player in VBA question

Not a media player expert, but I would guess from the code you have given,
lastpos = 0. Therefore you are trying to set CurrentPosition = -5, which, as
the error message states, is invalid.
So you have to set the value of lastpos somewhere and check its value

lastpos=MP.<SomeProperty
'code....
Const REWIND_SECONDS as long=5
if lastposREWIND_SECONDS then
MP.CurrentPosition = lastpos - REWIND_SECONDS
else
MP.CurrentPosition = 0
end if

Not sure what a CurrentPosition = -1 means, but check the docs.

NickHK

"teepee" wrote in message
...
I want to get media player to jump back 5 seconds with a VBA macro

I tried

Dim lastpos As Long
MP.CurrentPosition = lastpos - 5

but that didn't work. It just says:

run time error 380

currentposition must be -1.0 or greater than or equal to 0.0

Anyone know how it might be done?




  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Controlling media player in VBA question


"NickHK" wrote

Not a media player expert, but I would guess from the code you have given,
lastpos = 0. Therefore you are trying to set CurrentPosition = -5, which, as
the error message states, is invalid.

Thanks - will try that


  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Controlling media player in VBA question


"NickHK" wrote

Const REWIND_SECONDS as long=5
if lastposREWIND_SECONDS then
MP.CurrentPosition = lastpos - REWIND_SECONDS
else
MP.CurrentPosition = 0
end if

That worked. Thanks v much


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
Close Windows Media Player Cordell Excel Discussion (Misc queries) 1 January 30th 07 04:43 AM
Force asx to bring up Windows Media Player - How? chaser7016 Excel Discussion (Misc queries) 1 January 23rd 07 01:09 PM
Media player import to excel David Excel Discussion (Misc queries) 0 September 14th 06 01:39 AM
Media Player versus Windows Media Player teepee Excel Discussion (Misc queries) 1 October 14th 05 02:25 AM
Select player from list and get his position in next column Massivemike Excel Discussion (Misc queries) 2 September 10th 05 12:56 PM


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

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

About Us

"It's about Microsoft Excel"