Aus einem Projekt:

Erstellung:

Set Word = CreateObject("Application")

Application.Visible = False

Set objDocument = Documents.Add(AppPfad &
"AuswertungHaSoKa.dot")


'-------------------------------------------------------
------------------------
'  �ffnen aller Kostenstellen
'-------------------------------------------------------
------------------------
SQLKostenstellen = "SELECT Kostenstelle.ID,
Kostenstelle.Bezeichnung AS Kostenstelle,
Bereich.Bezeichnung AS Bereich, Firma.Bezeichnung AS
Firma FROM Kostenstelle INNER JOIN Bereich ON
Kostenstelle.BereichID = Bereich.ID INNER JOIN Firma ON
Bereich.FirmaID = Firma.ID Order By Kostenstelle,
Bereich, Firma"
ReadDatabase SQLKostenstellen, rsKostenstellen

'ActualKostenstelleID = rsKostenstellen.Fields("ID")
ActualKostenstelleID = 65 'In der Testphase
'-------------------------------------------------------
------------------------
TabellenZaehler = TabellenZaehler + 1
objDocument.Tables.Add Selection.Range,1,3,1
'-------------------------------------------------------
------------------------
Selection.TypeText
trim(rsKostenstellen.Fields("Kostenstelle"))
Selection.MoveRight 1,1
Selection.TypeText
trim(rsKostenstellen.Fields("Bereich"))
Selection.MoveRight 1,1
Selection.TypeText trim(rsKostenstellen.Fields("Firma"))
Selection.MoveDown 5,2
Selection.TypeParagraph
'------------------------------------
.
.
.
Quit '? Vielleicht ein Fehler im Quelltext
Set objWordApp = Nothing


Und eine Seite um das Dokument zum Server zu senden:
<%
Response.Buffer = TRUE
Response.Clear
Response.Expires = 0
Response.ContentType = "application/msword"

strFileName = "d:\Inetpub\wwwroot\h-k-s-
db\Application\auswertung\AuswertungHaSoKa.dot"
strMyPath   = strFileName

Response.AddHeader "Content-
Disposition","attachment;filename=" & strFileName

Set objFileSys =
Server.CreateObject("Scripting.FileSystemObject")

    ' --- Ermitteln der Dateigroesse
    Set objFile = objFileSys.GetFile(strMyPath)
        FileSize = objFile.Size
    Set objFile = Nothing

    ' --- �ffnen der Datei
    Set objFile = objFileSys.OpenTextFile(strMyPath, 1,
false, -1)

        ' --- Auslesen des Dateinhalts und Ausgabe
        ' --- per Response.BinaryWrite
        Response.BinaryWrite(objFile.Read(FileSize))

    Set objFile = Nothing

Set objFileSys = Nothing

Response.Flush
%>
Kann man eigentlich auch in einer Seite zusammenfassen.
Plus FSO einsatz um das Dokument gleich wieder zu
l�schen.

Gru�,
Andreas Roth,
http://ed59.s5.domainkunden.de/vt/?4


| [aspdedotnet] als [email protected] subscribed
| http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.dotnetgerman.com/listen/aspDEdotnet.asp

Antwort per Email an