Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:39 AM
Mark
Guest
 
Posts: n/a
Default 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!
  #2  
Old July 19th, 2005, 11:40 AM
Tom Kaminski [MVP]
Guest
 
Posts: n/a
Default Re: Generating Page Breaks in Word from ASP

"Mark" <anonymous@devdex.com> wrote in message
news:OB12ysw6DHA.2752@TK2MSFTNGP09.phx.gbl...[color=blue]
> 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,[/color]

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/



 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles