generate word document?

J

josepe

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!
 
J

John Blessing

josepe said:
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
 
B

Bob Barrows [MVP]

josepe said:
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
 
J

josepe

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.
 
B

Bob Barrows [MVP]

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top