Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > generate word document?

Reply
Thread Tools

generate word document?

 
 
josepe
Guest
Posts: n/a
 
      10-06-2005
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!


 
Reply With Quote
 
 
 
 
John Blessing
Guest
Posts: n/a
 
      10-06-2005
"josepe" <(E-Mail Removed)> wrote in message
news:OP%(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-06-2005
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...;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.


 
Reply With Quote
 
josepe
Guest
Posts: n/a
 
      10-06-2005
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]" <(E-Mail Removed)> escribió en el mensaje
news:(E-Mail Removed)...
> 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...;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.
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-06-2005
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]" <(E-Mail Removed)> escribió en el mensaje
> news:(E-Mail Removed)...
>> 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...;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.


 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to generate a user instance of SQL Server. Only an integratedconnection can generate a user instance. Harlan Messinger ASP .Net 2 03-28-2010 06:51 PM
How to generate warnings when How generate a warning when int is converted to bool or vice versa? PengYu.UT@gmail.com C++ 3 04-06-2006 11:24 PM
How to generate variable labels for same component within a generate loop Weng Tianxiang VHDL 5 02-16-2006 01:45 PM
Jakarta POI to generate MS Word documents mlv2312@terra.com.br Java 2 02-16-2005 08:39 PM
How to generate Word document using asp.net. ganesh ASP .Net 0 11-19-2003 02:47 AM



Advertisments