Function GetVideoDuration(fPName As String) As Long
'returns the duration in seconds of the specified video path+fPNamename
Dim oFolder, ofPName
With CreateObject("Shell.Application")
Set oFolder = .Namespace(Left(fPName, InStrRev(fPName, "\") - 1))
Set ofPName = oFolder.ParseName(Right(fPName, Len(fPName) - InStrRev(fPName, "\")))
GetVideoDuration = GetVideoDuration = oFolder.GetDetailsOf(ofPName, 27)
End With
End Function
Sub Test()
MsgBox GetVideoDuration("Path To Video Here\myVideo.mp4") ''///returns a duration in seconds
End Sub