Forum: ASP Classic |
Thema:
Inhalt eines Worddokuments in einer Variablen speichern |
Von:
G. Guest (
20.02.2003 09:40) |
Hallo!
Ich möchte den Inhalt von einem Worddokumnet in einer Variablen bzw. String abspeichern. Mit dem FileSystemObject funktioniert es beinahe, allerdings sind neben dem normalen Text noch wunderschöne Hieroglyphen enthalten.
Mein code sieht folgendermaßen aus:
<%Response.Buffer = TRUE
Response.Clear
Response.Expires = 0
Response.ContentType = "application/msword"
strFileName = "serienbrief1.doc"
strMyPath = Server.MapPath("serienbrief1.doc")
Response.AddHeader "Content-Disposition","attachment;filename=" & strFileName
Set objFileSys = Server.CreateObject("Scripting.Filesystemobject")
Set objFile = objFileSys.GetFile(strMyPath)
FileSize = objFile.Size
Set objFile = Nothing
Set objFile = objFileSys.OpenTextFile(strMyPath, 1, false, -1)
Response.BinaryWrite(objFile.Read(FileSize))
Set objFile = Nothing
Set objFileSys = Nothing
Response.Flush %>
Gruß Sandra
Betreff |
Von |
Datum |
|
|
Christian
Mairoll
|
20.02.2003 16:11 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!