473,698 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generate word document?

Hi,

I want to do a dinamicly generation of a word doc in my ASP page.
I do it with the next code:
<% Response.Conten tType = "applicatio n/msword"
Response.AddHea der "content-disposition", "inline; filename=OrderF ax.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!
Oct 6 '05 #1
4 3967
"josepe" <jo***@floraque en.com> wrote in message
news:OP******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

I want to do a dinamicly generation of a word doc in my ASP page.
I do it with the next code:
<% Response.Conten tType = "applicatio n/msword"
Response.AddHea der "content-disposition", "inline; filename=OrderF ax.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
Oct 6 '05 #2
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.Conten tType = "applicatio n/msword"
Response.AddHea der "content-disposition", "inline;
filename=OrderF ax.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.
Oct 6 '05 #3
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]" <re******@NOyah oo.SPAMcom> escribió en el mensaje
news:ur******** ******@TK2MSFTN GP10.phx.gbl...
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.Conten tType = "applicatio n/msword"
Response.AddHea der "content-disposition", "inline;
filename=OrderF ax.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.

Oct 6 '05 #4
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]" <re******@NOyah oo.SPAMcom> escribió en el mensaje
news:ur******** ******@TK2MSFTN GP10.phx.gbl...
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.Conten tType = "applicatio n/msword"
Response.AddHea der "content-disposition", "inline;
filename=OrderF ax.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.
Oct 6 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11292
by: Brian Kwan | last post by:
Project Description: Develop a web application to help manage sale operations. There is a function that to generate a report using data in database, which is a Word document on server and let user to download and print it out. Problem: Found that it's risky to do Word automation on server side using ASP. The layout of report is a bit complicated. I've a idea of ASP call VB to automate a Word document, but don't know whether it's work or...
4
7714
by: Jeff Harbin | last post by:
I've got an ACCESS 2000 application that I'm developing. One of the outputs of this app will be to generate a series of 'jobs' which corresponds to a record in the database. Each record will be printed on its own page which I've set up as a report and that's working fine. Accompanying each job is a Word (or Excel) document. Most jobs will have Word (or Excel) documents unique to the record. I know how to establish a hyperlink field...
0
1097
by: ganesh | last post by:
How to generate Word document using asp.net. other than using Response.ContentType = "application/msword" thnx Ganesh.
0
268
by: Novice | last post by:
Hi all, I'm a novice VB.NET and VBA programmer and am wondering if there is a tutorial out there on how to create a word document based on data in a database and then return that document to a web user. I'm using Visual Studio .Net 2003 for my IDE I am familiar enough with VBA to be able to write all the code to generate the document, it is just that I'm not certain how to create the word document in memory and not have Office pop-up on the...
10
1911
by: Noor | last post by:
Hi all, I need to well formatted ms word document through vb.net. All the data that will make the word document will come from the database. and formatted dynamically. Currently i have started doing it in crystal report and finally i will export that crystal report to ms word format.
3
30783
by: Adam Faulkner via DotNetMonster.com | last post by:
I want to create a method within a class that opens a Microsoft Word 2000 Document and has the facility to Create a new word document and then extract a Page that exists within the original Word Document and save it to a new Word Document. I would need to generate a loop for each page found within a word document to create a new word document and insert the existing page into the new word document and then save as a new word document. ...
2
1792
by: sqlster | last post by:
In asp.net/SQL Server application based on business rules, I would like to dynamically generate word documents. Content and layout would be fully customized.How do I go about doing it? I could use XML/XSLT solution but then xml file has to be created every time word document is generated and over time it would be waste of disk space. Based upon final sql query results, could I just use xslt document (with out xml document) and generate...
13
5451
by: Raja Raman Sundararajan | last post by:
Hello guys, Is there any nice library to generate word documents using Python. As of today I am generating a HTML document and then open it with MS Word. But the problem is that I am not able to control the pages in the document and as a result of it the output looks terrible. I have been using reportlab's platypus to generate PDF documents. Its a nice application which allows controlling segments of the pages
2
2190
by: jmar | last post by:
I am updating a VB4.0 quote generation program to VB.net. The old program takes user inputs, performs calculations, saves the data to Access databases and uses Crystal Reports 5.0 to generate a quote. A while back users obviously wanted to be able to edit/e-mail the quote (these ancient Cyrstal 5.0 reports don't allow PDF creation) so I modified the old VB4.0 code to allow users to save the Crystal Report as Word document which they can...
0
8668
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9152
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9014
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.