J
Jeremy
The ASP script below, grabs marked text from a web page and prints it for
printer friendly pages. I would like to be able to format the text output.
The statement that puts out the text is
response.write text
I have tried various ways of formating this statement and nothing works. How
can I get my printer friendly text into a formated table please?
Many thanks for your help! Jeremy
======================================================================================================================
<%
Dim page, text, filesys
page = request.querystring("page")
Sub ReplaceTxt(what,door)
Dim regularExpressionObject
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = what
.IgnoreCase = True
.Global = True
End With
text = RegularExpressionObject.Replace(text,door)
Set RegularExpressionObject = nothing
End Sub
'opening the page
Set FileSys = server.createobject("scripting.FileSystemObject")
text = filesys.openTextfile(server.mappath(page)).readall
call replacetxt("<!-- noprint -->","<!--")
call replacetxt("<!-- /noprint -->"," -->")
'writing the text-only version
response.write "<font size='2' face='arial'><b>Printer Friendly Version
of <i><a href='javascript:history.go(-1)'>"&page&"</a></i></b></font><br><hr
noshade color='#000000' size='1'>"
response.write text
response.write "<p align='center'><font size='1'
face='verdana'>Copyright (C) 2002 Pete Yagmin<br>This page was printed from
Your Website at http://www.yourwebaddress.com</font></p>"
%>
===================================================================================================================
printer friendly pages. I would like to be able to format the text output.
The statement that puts out the text is
response.write text
I have tried various ways of formating this statement and nothing works. How
can I get my printer friendly text into a formated table please?
Many thanks for your help! Jeremy
======================================================================================================================
<%
Dim page, text, filesys
page = request.querystring("page")
Sub ReplaceTxt(what,door)
Dim regularExpressionObject
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = what
.IgnoreCase = True
.Global = True
End With
text = RegularExpressionObject.Replace(text,door)
Set RegularExpressionObject = nothing
End Sub
'opening the page
Set FileSys = server.createobject("scripting.FileSystemObject")
text = filesys.openTextfile(server.mappath(page)).readall
call replacetxt("<!-- noprint -->","<!--")
call replacetxt("<!-- /noprint -->"," -->")
'writing the text-only version
response.write "<font size='2' face='arial'><b>Printer Friendly Version
of <i><a href='javascript:history.go(-1)'>"&page&"</a></i></b></font><br><hr
noshade color='#000000' size='1'>"
response.write text
response.write "<p align='center'><font size='1'
face='verdana'>Copyright (C) 2002 Pete Yagmin<br>This page was printed from
Your Website at http://www.yourwebaddress.com</font></p>"
%>
===================================================================================================================