Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2005, 08:35 AM
Authorized User
 
Join Date: Jan 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP and word documents

I have the following code which works and writes to a simple word temaplate. However, I want to:
1) use a specific template to acheive this, and
2) would like to ensure the content appears in a specific position

The solution to 1 will be good enough.

Thanks in advance.

<%
Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "attachment;filename=quotes.doc"

dim quoteTable

quoteTable="<table cellpadding='1' cellspacing='0' wisth='100%'><tr><td colspan='5'><h3 style='padding-left:10px;'>Existing quotes</h3></td></tr>"
quoteTable=quoteTable & "<tr bgcolor='#ADCCE4'><td class='right_text'><strong>Date of quote</strong></td>"
quoteTable=quoteTable & "<td class='right_text'><strong>Quote</strong></td>"
quoteTable=quoteTable & "<td class='right_text'><strong>Item</strong></td>"
quoteTable=quoteTable & "<td class='right_text'><strong>Cost</strong></td>"
quoteTable=quoteTable & "<tr><td class='right_text'>Date of quote</td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;1500.00</td>"
quoteTable=quoteTable & "<td class='right_text'>Item</td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;1500.00</td>"
quoteTable=quoteTable & "<tr><td class='right_text'>Date of quote</td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;1500.00</td>"
quoteTable=quoteTable & "<td class='right_text'>Item</td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;1500.00</td>"
quoteTable=quoteTable & "<tr><td class='right_text'>Date of quote</td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;1500.00</td>"
quoteTable=quoteTable & "<td class='right_text'>Item</td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;1500.00</td>"
quoteTable=quoteTable & "<tr><td class='right_text' colspan='4'>&nbsp;</td></tr>"
quoteTable=quoteTable & "<tr><td class='right_text'><strong>Totals</strong></td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;4500.00</td>"
quoteTable=quoteTable & "<td class='right_text'>&nbsp;</td>"
quoteTable=quoteTable & "<td class='right_text'>&pound;4500.00</td>"
quoteTable=quoteTable & "<td class='right_text'>&nbsp;</td></tr>"

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
     <title>Untitled</title>
     <style type="text/css">

     .BigTitle {
     font-family: Verdana, Sans-Serif;
     font-size: 20pt;
     font-weight: bold;
     color: #004080;
     }

     .UserDetails {
     font-family: Courier New, Monospace;
     font-size: 12pt;
     }
     .right_text {
     font-family: Verdana, Arial, Helvetica, sans-serif;
     font-size: 12px;
     color: #666666;
     line-height: 15px;
     padding-left: 10px;
}
     </style>
</head>

<body>

<span class="BigTitle">Quotes</span>

<span class="UserDetails"><%=quoteTable%></span>

</body>
</html>
 
Old August 11th, 2005, 04:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

check out http://www.greggriffiths.org/webdev/both/excel/ which covers a similar issue for Excel.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating MS Word documents in ASP Nicky2k Classic ASP Components 3 April 10th, 2007 08:12 AM
assigning macros to word documents dynamically x_ray C# 0 May 30th, 2006 10:29 AM
Inserting Word Documents into Access showie Access VBA 4 December 14th, 2005 02:02 PM
comparision of two word documents anuradhad VB How-To 1 July 24th, 2004 04:10 PM
Processing a list of word documents from VB rohan101 Pro VB 6 2 February 16th, 2004 09:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.