Extract media time to use as slide transition time

gailb
3StarLounger
Posts: 256
Joined: 09 May 2020, 14:00

Extract media time to use as slide transition time

Post by gailb »

I have recorded media on all slides. I now run a macro to update the slide transition time to match this time, plus 1.

So, if my slide media is 33208, the code looks at the left 2 digits, and that is the total seconds for the media on that slide.

Code: Select all

myTime = Left(shp.MediaFormat.length,2)
.advanceTime = myTime + 1
This gets me a 34 second advanced time in the 33208 example above.

Right now I stumped on a time like 140985. That should be around 2:21, but I guess by adding one it could be 2:22.

Any thought on how I can do this?

User avatar
HansV
Administrator
Posts: 79671
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Extract media time to use as slide transition time

Post by HansV »

Do you want a number of seconds or a time value?
Best wishes,
Hans

gailb
3StarLounger
Posts: 256
Joined: 09 May 2020, 14:00

Re: Extract media time to use as slide transition time

Post by gailb »

Whatever number will update the advance slide time. When I look on the Transition tab under the Timing grouping, the After shows it in minutes and seconds.

User avatar
HansV
Administrator
Posts: 79671
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Extract media time to use as slide transition time

Post by HansV »

Time in seconds would be

Int(shp.MediaFormat.Length / 1000) + 1

To get it as time, divide the above expression by 86400.
Best wishes,
Hans

gailb
3StarLounger
Posts: 256
Joined: 09 May 2020, 14:00

Re: Extract media time to use as slide transition time

Post by gailb »

Thanks Hans. This did it.