Is this possible (Classic ASP Question)

Soldato
Joined
20 Oct 2002
Posts
6,212
Location
UK
Hi,

Is it possible to have a script within a web page written in ASP which parses word files within a folder and subsequently creates html links to said documents on the web page?

If so, are there any tutorials that anyone knows about or any specific functions which i could be pointed towards please?

Thanks,

Matt
 
Actually "Parse" the word file or "traverse" the folder and create a hyperlink to said document(s) in a nice HTML page?
 
Thats pretty straightforward. What you'll need to use is the FileSystemObject (have a google).

You can use this to traverse the folder and file structure of the machine, and then create links to the documents you need. Note though, that if the documents are outside of the website (like on another drive or machine) you may run into some permissions problems.

*edit*
Actually, J is right, you say parse (as in read the contents of the word document) and then say you just need to create a link to them. If you actually want to read the word document you'll need to ensure Word is installed on the server and then you'll need this code:

Code:
<%
	sDocpath = "test.doc"
	set oWord = Server.CreateObject("Word.Application")
		sText = oWord.documents.open(sDocpath).Content.Text
	oWord.quit
	
	response.write(sText)
%>
 
Last edited:
sorry parse was the wrong word to use... i litterally only want to create links to any documents present in the folder, i dont need to parse the content... just traverse the folder, apologies for the confusion.

I'll look into the FileSystemObject function and have a little play this afternoon.

Many thanks :-)
 
Back
Top Bottom