Generating Page Breaks in Word from ASP

Discussion in 'ASP General' started by Mark, Feb 4, 2004.

  1. Mark

    Mark Guest

    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!
    Mark, Feb 4, 2004
    #1
    1. Advertising

  2. "Mark" <> wrote in message
    news:...
    > 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/windowsserver2003/community/centers/iis/
    Tom Kaminski [MVP], Feb 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. srk
    Replies:
    0
    Views:
    619
  2. srk
    Replies:
    0
    Views:
    594
  3. AV

    Page Number and Page Breaks

    AV, Oct 28, 2003, in forum: ASP General
    Replies:
    4
    Views:
    137
  4. Orion Forever

    Managing Page Breaks in an ASP Page

    Orion Forever, May 1, 2009, in forum: ASP General
    Replies:
    2
    Views:
    126
    Orion Forever
    May 1, 2009
  5. Lance Hoffmeyer

    Win32::OLE MS Word line breaks regex

    Lance Hoffmeyer, Feb 3, 2007, in forum: Perl Misc
    Replies:
    1
    Views:
    175
    Mumia W. (NOSPAM)
    Feb 4, 2007
Loading...

Share This Page