MS word document

Discussion in 'ASP General' started by josepe, Oct 31, 2005.

  1. josepe

    josepe Guest

    Hello,

    I want to do a Ms Word document in a ASP page.
    I can do it, With the code lines:
    /////
    Response.ContentType = "application/msword"
    Response.AddHeader "content-disposition", "inline; filename=OrderFax.doc"
    ////
    With these lines all document content show like a Word document.

    But i can not change the MARGINS of this Word document.And Default
    left/right margins are very bigs.
    I try it, change the <body> attributes and with styles, but this don't work,
    the margins are always the same.

    How can i modify the margins of word document?
    I should do this with another method?
    Can I modify PC client settings to change the defaults margins of word
    document create througt the web?

    Some idea?

    Thanks a lot.
    josepe, Oct 31, 2005
    #1
    1. Advertising

  2. josepe wrote:
    > Hello,
    >
    > I want to do a Ms Word document in a ASP page.
    > I can do it, With the code lines:
    > /////
    > Response.ContentType = "application/msword"
    > Response.AddHeader "content-disposition", "inline;
    > filename=OrderFax.doc" ////
    > With these lines all document content show like a Word document.
    >
    > But i can not change the MARGINS of this Word document.And Default
    > left/right margins are very bigs.
    > I try it, change the <body> attributes and with styles, but this
    > don't work, the margins are always the same.
    >


    Create a document in Word that has the margin settings you want. Then save
    it to html and view its source to see the html you need to generate to set
    the margins.

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Oct 31, 2005
    #2
    1. Advertising

  3. josepe

    Larry Bud Guest

    > How can i modify the margins of word document?
    > I should do this with another method?
    > Can I modify PC client settings to change the defaults margins of word
    > document create througt the web?
    >
    > Some idea?


    Besides reverse engineering as Bob suggested, MS has a document
    associated with HTML and office products and all the attributes that
    you can set:

    http://msdn.microsoft.com/library/d...ry/en-us/dnoffxml/html/ofxml2k.asp?frame=true
    Larry Bud, Nov 1, 2005
    #3
  4. Ok bob,
    I do it, but don't works.

    I put all the text that Word generate for the html file with correct
    margins.
    And append to this file this code:
    ////
    Response.ContentType = "application/msword"
    Response.AddHeader "content-disposition", "inline;
    filename=OrderFax.doc"
    ////
    to the asp file.

    And the result is the same.
    Open Ms Word file with correct data but wrong margins, always the same
    long margins.

    Some idea?

    Thanks a lot.

    *** Sent via Developersdex http://www.developersdex.com ***
    Josep Estudis Figueras, Nov 2, 2005
    #4
  5. Josep Estudis Figueras wrote:
    > Ok bob,
    > I do it, but don't works.
    >
    > I put all the text that Word generate for the html file with correct
    > margins.
    > And append to this file this code:
    > ////
    > Response.ContentType = "application/msword"
    > Response.AddHeader "content-disposition", "inline;
    > filename=OrderFax.doc"
    > ////
    > to the asp file.
    >
    > And the result is the same.
    > Open Ms Word file with correct data but wrong margins, always the same
    > long margins.
    >
    > Some idea?
    >


    Other than suggesting that you read the link provided by Larry, none.


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Nov 2, 2005
    #5
    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. Laura
    Replies:
    1
    Views:
    526
    Gunnar Hjalmarsson
    Jun 5, 2004
  2. Stephen Witter

    opening a word doc in word not browser

    Stephen Witter, May 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    476
    Stephen Witter
    May 18, 2004
  3. srk
    Replies:
    0
    Views:
    635
  4. srk
    Replies:
    0
    Views:
    606
  5. Michael G. Schneider

    Modifying a Word document without using Word Automation

    Michael G. Schneider, Dec 15, 2003, in forum: ASP General
    Replies:
    5
    Views:
    279
    el.c. - myLittleTools.net
    Dec 16, 2003
Loading...

Share This Page