
03/09/2002, 14:47
|
 | | | Fecha de Ingreso: febrero-2002 Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 23 años, 3 meses Puntos: 29 | |
Re: Doc automático Y así funcionaría?:
<%
Option Explicit
HTML2Word "http://" & Server.MapPath("noticia.asp?id="&Req uest.Form("id")), Server.MapPath(Request.Form("id")&&q uot;.doc")
Response.Write "Finnished at: " & Now()
Sub HTML2Word(ByRef pstrSourceURL, ByRef pstrTargetFile)
Dim lobjWordApp
Dim lobjInternetExplorer
Set lobjWordApp = Server.CreateObject("Word.Document")
Set lobjInternetExplorer = Server.CreateObject("InternetExplorer.Applica tion")
lobjInternetExplorer.Navigate pstrSourceURL
IEStandBy lobjInternetExplorer
lobjInternetExplorer.document.body.createTextRange .execCommand("Copy")
IEStandBy lobjInternetExplorer
lobjWordApp.Content.Paste
lobjWordApp.SaveAs pstrTargetFile
lobjWordApp.Close
lobjInternetExplorer.Quit
Set lobjInternetExplorer = Nothing
Set lobjWordApp = Nothing
End Sub
Sub IEStandBy(ByRef pobjInternetExplorer)
' Not good (Pegs system resources)
' Need to find a way to "sleep"
While pobjInternetExplorer.busy:Wend
While Not pobjInternetExplorer.Document.readyState = "complete":Wend
End Sub
%>
<center><hr size="1" color="blue" width="39%"><a href="http://www.ommadawn.es.vg" target="_blank"><font color="red">www.Ommadawn.es.vg[/CODE]</a><hr size="1" color="blue" width="39%"> |