ASP to Word

J

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
 
B

Baconbutty

Joe said:
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
 
L

Larry Bud

Joe said:
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/default.asp?url=/library/en-us/dnoffxml/html/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.
 

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,773
Messages
2,569,594
Members
45,122
Latest member
VinayKumarNevatia_
Top