473,395 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Generating Page Breaks in Word from ASP

Hi - apologies in advance if this is not the correct forum - tried
searching loads, and still to find a workable solution.

Generating a word document from ASP - no problem. Inserting page breaks
into the generated page, so that when loaded into Word it forces a page
break, I cannot manage:

No matter if I use:

<p STYLE="page-break-after: always"></p>

or

<%=chr(10)%><%=chr(13)%>

...when opened in Word it will not start content on a new page.

Any ideas? Thank you,

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Response.Buffer = TRUE
Response.ContentType = "application/msword"
response.AddHeader "content-disposition", "inline; filename=xxx.doc"
%>
<%
'code to get a recordset here
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body style="font:verdana">
<p>&nbsp;</p>
' first generate table of contents
<% for i = 0 to numrows %>
<%=rsSolArr(0,i)%>: <a href="#<%=rsSolArr(0,i)%>"><%=rsSolArr(1,i)%></a>
<br>
<% next %>

'now generate actual content
<% for i = 0 to numrows %>
<p STYLE="page-break-after: always"></p>
<a name="<%=rsSolArr(0,i)%>"></a><%=rsSolArr(0,i)%>:
<%=rsSolArr(1,i)%><br>
<%=rsSolArr(2,i)%><br><br><%=chr(10)%><%=chr(13) %>
</div>
<% next %>
</body>
</html>


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
1 3518
"Mark" <an*******@devdex.com> wrote in message
news:OB**************@TK2MSFTNGP09.phx.gbl...
Hi - apologies in advance if this is not the correct forum - tried
searching loads, and still to find a workable solution.

Generating a word document from ASP - no problem. Inserting page breaks
into the generated page, so that when loaded into Word it forces a page
break, I cannot manage:

No matter if I use:

<p STYLE="page-break-after: always"></p>

or

<%=chr(10)%><%=chr(13)%>

..when opened in Word it will not start content on a new page.

Any ideas? Thank you,


How about the "reverse engineering" approach. Create a Word doc with a page
break, then save it as HTML and see what it gives you ...

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: RiGGa | last post by:
Hi, I want to parse a web page in Python and have it write certain values out to a mysql database. I really dont know where to start with parsing the html code ( I can work out the database...
4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
4
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary...
10
by: Noor | last post by:
Hi all, I need to well formatted ms word document through vb.net. All the data that will make the word document will come from the database. and formatted dynamically. Currently i have...
0
by: bblue | last post by:
hi, I need help in implementing page breaks in XML files? any suggestion on how can this be done? do you recommend using processing instructions or add a new elements would make more sense? can the...
0
by: srk | last post by:
hi to all, i need some help , my problem is that i have to generate a word document withe the data from data base and it should be displayed as tables in word and i have to insert some header and...
20
MMcCarthy
by: MMcCarthy | last post by:
This problem was proposed to me but not really my area of expertise so I thought I would open it up to the forum to see if anyone had any bright ideas. The problem is generating Microsoft Word...
2
by: Taftheman | last post by:
Hi, i have a problem forceing page breaks in word via a vb6 application i have the following code but it does not seem to like it , can any body help .Tables(1).Split.AllowPageBreaks = True
2
AllusiveKitten
by: AllusiveKitten | last post by:
Hi All Program: Microsoft Word 2003 Back ground I am trying to write a macro to insert a landscape page into a portrait document. Firstly the code must find out if there is a following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.