Open .rtf and post back to webpage retaining formatting

shovmyfist

New member
Joined
Aug 5, 2005
Messages
2
Programming Experience
1-3
I want to be able to take a .doc or .rtf and write it to the screen using asp. I currently wrote a script that opens a .doc file using word and saves it as .html then the page opens a frame that is linked to the new .html file. When this is run locally it works great but when other ppl run it on hte server it asks for user name/password. I played around with that making a new account etc but it seems to just cause problems. This was also has to open winword.exe everytime which can slow down the server. Is there a way to instead of using word to open a .doc that i can use wordpad to open .rtf and write it to the screen. From what i understand rtf is also to be ecoded without even opening wordpad on the server.

The reson i am not just using a txt file is becuase i want to retain the formatting in the document like bold, color, etc.

I am optumily looking to Open a .rtf file and re-encode it into html language which could then be posted back to the page. Any other suggestions here?

This is what i currenly have which opens winword on the server everytime:


<%@ Page aspcompat=true language="VBScript" %>

<%
Dim word, file
'--starting word
word = Server.CreateObject("Word.Application")
'--if you want see the World interface the value must be '1' else '0'
word.Visible = 0

'--doc file location
word.Documents.Open(Server.MapPath("OpenFilePathOnServer"))


'--html file location '8' mean HTML format
word.Documents(1).SaveAs(Server.MapPath("SaveFilePathOnServerAsHTML"), 8)

'--closing word
word.Quit()

'--free the object from the memory
word = Nothing

%>



thanks much!!!
Kenny
 
Back
Top