L
leonello
hello
il codice qui in vb6 e' ok,ma se lo uso in VBA cpn poerpoint
l'API in oggetto non funziona...che cosa sbaglio ?
Dim cmdToDo As String
Dim dwreturn As Long
Dim ret As String * 128
Dim tmp As String * 255
Dim lenShort A s Long
Dim ShortPathAndfile As String
tmp = ""
'
lenShort = GetShortPathName(Filename, tmp, 255)
ShortPathAndfile = Left$(tmp, lenShort)
'
cmdToDo = "open " & ShortPathAndfile & " type MPEGVideo Alias mpeg"
dwreturn = mciSendString(cmdToDo, 0&, 0&, 0&)
If dwreturn <> 0 Then GoTo errore
'
dwreturn = mciSendString("status mpeg length", ret, Len(ret), 0&)
'
errore:
If dwreturn <> 0 Then 'Print Not success
mciGetErrorString dwreturn, ret, 128
MsgBox ret, vbCritical
Exit Function
End If
'----------------------------
dwreturn = mciSendString("play mpeg", 0&, 0&, 0&)
'-------------------------------------
If dwreturn <> 0 Then
mciGetErrorString dwreturn, ret, 128
MsgBox ret, vbCritical
Exit Function
End If
graie1000
leonello
il codice qui in vb6 e' ok,ma se lo uso in VBA cpn poerpoint
l'API in oggetto non funziona...che cosa sbaglio ?
Dim cmdToDo As String
Dim dwreturn As Long
Dim ret As String * 128
Dim tmp As String * 255
Dim lenShort A s Long
Dim ShortPathAndfile As String
tmp = ""
'
lenShort = GetShortPathName(Filename, tmp, 255)
ShortPathAndfile = Left$(tmp, lenShort)
'
cmdToDo = "open " & ShortPathAndfile & " type MPEGVideo Alias mpeg"
dwreturn = mciSendString(cmdToDo, 0&, 0&, 0&)
If dwreturn <> 0 Then GoTo errore
'
dwreturn = mciSendString("status mpeg length", ret, Len(ret), 0&)
'
errore:
If dwreturn <> 0 Then 'Print Not success
mciGetErrorString dwreturn, ret, 128
MsgBox ret, vbCritical
Exit Function
End If
'----------------------------
dwreturn = mciSendString("play mpeg", 0&, 0&, 0&)
'-------------------------------------
If dwreturn <> 0 Then
mciGetErrorString dwreturn, ret, 128
MsgBox ret, vbCritical
Exit Function
End If
graie1000
leonello