473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP to Word

Joe
Hi.

I'm using ASP to pull info from a database and open it in Word. Everything works fine but I want to specify the paper size to be Legal. Is this possible or am I stuck with Letter size?

Thanks

Joe
Mar 26 '06 #1
3 1837

Joe wrote:
Hi.

I'm using ASP to pull info from a database and open it in Word. Everything works fine but I want to specify the paper size to be Legal. Is this possible or am I stuck with Letter size?

Thanks

Joe


Questions:-

1. When you say "pull info" do you mean that your database has an
existing Word document as a BLOB or something? If not, what is the
format of your "info" and how are you opening it in Word?
2. When you say "open it in Word", do you mean client side or server
side?

Generally, the only way I can think of is to automate the instance of
the Word application you are running.

In JavaScript, something like:-

try
{
var oWord=GetObject("","Word.Application");
oWord.ActiveDocument.PageSetup.PaperSize=4; // wdPaperLegal
}
catch(e)
{
alert("Could not find or access an instance of Word.Application, or
there was no ActiveDocument open.");
}

However, on the client side, I think security restrictions are going to
be a problem.

Regards

Julian Turner

Mar 27 '06 #2

Joe wrote:
Hi.

I'm using ASP to pull info from a database and open it in Word. Everything works fine but I want to specify the paper size to be Legal. Is this possible or am I stuck with Letter size?


Sure
http://msdn.microsoft.com/library/de...ml/ofxml2k.asp

Using some meta data you can define all sorts of things. One of the
easy ways to do this is to create a simple word doc with legal paper
size, and do a Save as HTML and review the code.

Mar 27 '06 #3
Joe
Thanks. That did the trick.
Joe

"Larry Bud" <la**********@yahoo.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...

Joe wrote:
Hi.

I'm using ASP to pull info from a database and open it in Word.
Everything works fine but I want to specify the paper size to be Legal.
Is this possible or am I stuck with Letter size?


Sure
http://msdn.microsoft.com/library/de...ml/ofxml2k.asp

Using some meta data you can define all sorts of things. One of the
easy ways to do this is to create a simple word doc with legal paper
size, and do a Save as HTML and review the code.

Mar 27 '06 #4

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

Similar topics

7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
by: beanie | last post by:
i am a c programming beginner and i am trying to Create a concordance of Word Count for a text File in c programming but my code isn't working.please can u help me out.here is my code: #include...
0
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and ...
5
by: alivip | last post by:
How can I get every Token (word) and PreviousToken(Previous word) From multube files and frequency of each two word my code is trying to get all single word and double word (every Token (word) and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.