api GetShortPatName

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top