Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/06/2002, 03:44
Yoston
 
Fecha de Ingreso: mayo-2002
Mensajes: 83
Antigüedad: 22 años, 11 meses
Puntos: 0
Re: convertir DOC, XLS, PPT y TXT a HTML

Private Sub SplitPath(ByVal Fullpath As String, _
Optional ByRef Drive As String, _
Optional ByRef Path As String, _
Optional ByRef File As String, _
Optional ByRef Title As String, _
Optional ByRef Suffix As String)
Dim iPos As Long
If Mid$(Fullpath, 2, 1) = ":" Then
Drive = Left$(Fullpath, 2)
Fullpath = Mid$(Fullpath, 3)
ElseIf Left$(Fullpath, 2) = "\\" Then
iPos = InStr(3, Fullpath, "\")
Drive = Left$(Fullpath, iPos - 1)
Fullpath = Mid$(Fullpath, iPos)
End If
For iPos = Len(Fullpath) To 1 Step -1
If Mid$(Fullpath, iPos, 1) = "\" Then Exit For
Next iPos
Path = Left$(Fullpath, iPos)
File = Mid$(Fullpath, iPos + 1)
For iPos = Len(File) To 1 Step -1
If Mid$(File, iPos, 1) = "." Then Exit For
Next iPos
If iPos Then
Title = Left$(File, iPos - 1)
Suffix = Mid$(File, iPos + 1)
Else
Title = File
Suffix = ""
End If
End Sub
***************
Compilamos nuestro proyecto y generamos la DLL
si es necesario registramos la DLL
regsvr32 midll.dll
y ya....vamos a la pagina ASP
******pagina.asp*******
<%
dim x
set x = CreateObject("midll.covertir")
'->transformar([documeto],[Tipo],[Destino])
'->Tipo:doc,txt,xls,ppt
response.write x.transformar("c:\Documento.doc","D OC","c:\inetpub\wwwroot\")
response.write x.transformar("c:\Excel.doc","xls&q uot;,"c:\")
response.write x.transformar("c:\Presentacion.ppt",&quo t;ppt","a:\")
response.write x.transformar("c:\texto.txt","TXT&q uot;,"a:\")
set x = nothing
%>
el archivo sera guardado con el mismo nombre pero .htm ej:
transformar("c:\Excel.doc","xls&quo t;,"c:\")
en el dir c:\ quedara un archivo Excel.htm
*******en visual Basic**********
Private Sub Transforma_Click()
dim t
set t= createObject("midll.Convertir")
msgbox t.transformar("c:\Excel.doc","xls&q uot;,"c:\")
set t= nothing
End Sub

bueno espero que le sirva a alguien.
gracias por su tiempo.
si alguien vive en miami y tiene trabajo me avisa
chausito..