Carlos: Pegá el código que está entre líneas a continuación del anterior
______________________________________________________
Public Function ShellDoc(ByVal strRuta As String, Optional Parametros As String = "", Optional Verbo As ShellVerb = shvAbrir, Optional strDir As String = "", Optional TipoVentana As eMostrarPrograma = vbNormalFocus, Optional ByVal HWND As Long = 0) As Boolean
Dim shType As SHELLEXECUTEINFO
If strDir = "" Then strDir = DirectorioDeTrabajo(strRuta)
With shType
.cbSize = Len(shType)
.HWND = HWND
.lpDirectory = strDir
.lpFile = strRuta
.lpParameters = Parametros
If Verbo < shvEditar Or Verbo > shvPropiedades Then Verbo = shvAbrir
.lpVerb = Choose(Verbo, "edit", "explore", "open", "print", "properties")
.nShow = TipoVentana
.fMask = SEE_MASK_CONNECTNETDRV Or SEE_MASK_DOENVSUBST Or _
SEE_MASK_FLAG_DDEWAIT Or SEE_MASK_HOTKEY Or IIf(Verbo = 5, SEE_MASK_INVOKEIDLIST, 0)
End With
ShellDoc = (ShellExecuteEx(shType) <> 0)
End Function
Public Function DirectorioDeTrabajo(ByVal Ruta As String) As String
On Local Error Resume Next
Dim S() As String, e As Long
S = Split(Ruta, "\", -1, vbTextCompare)
e = ElementosDeLaMatriz(S)
If e > 0 Then
If UBound(S) > 0 Then
ReDim Preserve S(0 To (UBound(S) - 1)) As String
Else
ReDim Preserve S(0) As String
End If
DirectorioDeTrabajo = Join(S, "\")
Else
DirectorioDeTrabajo = ""
End If
Erase S
End Function
Public Function EsUnaMatrizVacia(ByRef Matriz As Variant) As Boolean
On Local Error Resume Next
Dim lng As Long
lng = UBound(Matriz)
EsUnaMatrizVacia = (Err.Number <> 0)
End Function
Public Function ElementosDeLaMatriz(ByRef Matriz As Variant) As Long
On Local Error Resume Next
If EsUnaMatrizVacia(Matriz) = True Then ElementosDeLaMatriz = 0: Exit Function
ElementosDeLaMatriz = (UBound(Matriz) - LBound(Matriz) + 1)
End Function
________________________________________________________
Continúa en el próximo mensaje ...