generate word document?

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

  1. josepe

    josepe Guest

    Hi,

    I want to do a dinamicly generation of a word doc in my ASP page.
    I do it with the next code:
    <% Response.ContentType = "application/msword"
    Response.AddHeader "content-disposition", "inline; filename=OrderFax.doc" %>

    But i have a problem with the margins of the word doc, by default the
    margins are:
    left:3.17 cm, right: 3.17cm.
    (Are not the margins of normal.dot...?)

    How can i modify these margins? In my ASP page? can i do it in my MS word
    application?

    Any idea?

    Thanks a lot!
     
    josepe, Oct 6, 2005
    #1
    1. Advertising

  2. "josepe" <> wrote in message
    news:OP%...
    > Hi,
    >
    > I want to do a dinamicly generation of a word doc in my ASP page.
    > I do it with the next code:
    > <% Response.ContentType = "application/msword"
    > Response.AddHeader "content-disposition", "inline; filename=OrderFax.doc"
    > %>
    >
    > But i have a problem with the margins of the word doc, by default the
    > margins are:
    > left:3.17 cm, right: 3.17cm.
    > (Are not the margins of normal.dot...?)
    >
    > How can i modify these margins? In my ASP page? can i do it in my MS word
    > application?
    >
    > Any idea?
    >
    > Thanks a lot!


    Not an answer but ... don't do it. MS Word is not designed to be used by web
    applications. Let's say it pops up a dialog box - who is going to be sat at
    the web server to click Yes/No?

    --
    John Blessing

    http://www.LbeHelpdesk.com - Help Desk software priced to suit all
    businesses
    http://www.room-booking-software.com - Schedule rooms & equipment bookings
    for your meeting/class over the web.
    http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
    http://www.outlook-find-replace.com - Find & Replace in Emails, Contacts,
    Appointments, Tasks and Notes
     
    John Blessing, Oct 6, 2005
    #2
    1. Advertising

  3. josepe wrote:
    > Hi,
    >
    > I want to do a dinamicly generation of a word doc in my ASP page.
    > I do it with the next code:
    > <% Response.ContentType = "application/msword"
    > Response.AddHeader "content-disposition", "inline;
    > filename=OrderFax.doc" %>
    >
    > But i have a problem with the margins of the word doc, by default the
    > margins are:
    > left:3.17 cm, right: 3.17cm.
    > (Are not the margins of normal.dot...?)
    >
    > How can i modify these margins? In my ASP page? can i do it in my MS
    > word application?
    >

    Just to add to John's reply:
    http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757

    If you insist on using automation, then you will need to discover the VBA
    commands for doing what you want. You can try the Word online help, record a
    macro in Word, or ask in a Word newsgroup.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Oct 6, 2005
    #3
  4. josepe

    josepe Guest

    Ok Thanks a lot.
    I read the reference that you send me, but now i use the
    MIME: word type to show the html page and then word shows the page like
    a .doc document. (No server-side creation)

    I understood that Microsoft recomend this way to do word documents, but i
    don't founded
    nothing about margins settings in my HTML/WORD page.

    Do you know something about this?

    Thanks a lot.

    "Bob Barrows [MVP]" <> escribió en el mensaje
    news:...
    > josepe wrote:
    >> Hi,
    >>
    >> I want to do a dinamicly generation of a word doc in my ASP page.
    >> I do it with the next code:
    >> <% Response.ContentType = "application/msword"
    >> Response.AddHeader "content-disposition", "inline;
    >> filename=OrderFax.doc" %>
    >>
    >> But i have a problem with the margins of the word doc, by default the
    >> margins are:
    >> left:3.17 cm, right: 3.17cm.
    >> (Are not the margins of normal.dot...?)
    >>
    >> How can i modify these margins? In my ASP page? can i do it in my MS
    >> word application?
    >>

    > Just to add to John's reply:
    > http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757
    >
    > If you insist on using automation, then you will need to discover the VBA
    > commands for doing what you want. You can try the Word online help, record
    > a
    > macro in Word, or ask in a Word newsgroup.
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    josepe, Oct 6, 2005
    #4
  5. Create a Word document with the correct margin settings and save it as HTML.
    Look at the HTML to see where the settings are made and duplicate that HTML
    in your generated document.

    Bob Barrows

    josepe wrote:
    > Ok Thanks a lot.
    > I read the reference that you send me, but now i use the
    > MIME: word type to show the html page and then word shows the page
    > like a .doc document. (No server-side creation)
    >
    > I understood that Microsoft recomend this way to do word documents,
    > but i don't founded
    > nothing about margins settings in my HTML/WORD page.
    >
    > Do you know something about this?
    >
    > Thanks a lot.
    >
    > "Bob Barrows [MVP]" <> escribió en el mensaje
    > news:...
    >> josepe wrote:
    >>> Hi,
    >>>
    >>> I want to do a dinamicly generation of a word doc in my ASP page.
    >>> I do it with the next code:
    >>> <% Response.ContentType = "application/msword"
    >>> Response.AddHeader "content-disposition", "inline;
    >>> filename=OrderFax.doc" %>
    >>>
    >>> But i have a problem with the margins of the word doc, by default
    >>> the margins are:
    >>> left:3.17 cm, right: 3.17cm.
    >>> (Are not the margins of normal.dot...?)
    >>>
    >>> How can i modify these margins? In my ASP page? can i do it in my MS
    >>> word application?
    >>>

    >> Just to add to John's reply:
    >> http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757
    >>
    >> If you insist on using automation, then you will need to discover
    >> the VBA commands for doing what you want. You can try the Word
    >> online help, record a
    >> macro in Word, or ask in a Word newsgroup.
    >>
    >> Bob Barrows
    >> --
    >> Microsoft MVP -- ASP/ASP.NET
    >> Please reply to the newsgroup. The email account listed in my From
    >> header is my spam trap, so I don't check it very often. You will get
    >> a quicker response by posting to the newsgroup.


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Oct 6, 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. ganesh
    Replies:
    0
    Views:
    634
    ganesh
    Nov 19, 2003
  2. srk
    Replies:
    0
    Views:
    644
  3. srk
    Replies:
    0
    Views:
    612
  4. Michael G. Schneider

    Modifying a Word document without using Word Automation

    Michael G. Schneider, Dec 15, 2003, in forum: ASP General
    Replies:
    5
    Views:
    284
    el.c. - myLittleTools.net
    Dec 16, 2003
  5. Brian Kwan
    Replies:
    3
    Views:
    217
    Bullschmidt
    Oct 17, 2005
Loading...

Share This Page