linking ASP to client MS Word

D

Dan Nash

Hi guys

Basically, I want to be able to print labels and invoices (via MS Word) for
net orders, using our ASP site admin system.

Heres the code I've come up with...

<%
Call OpenDBConnection("data")

set labeldata = dConn.Execute("SELECT * FROM Orders ORDER BY OrderNo DESC")

address = labeldata("CartID")
firstline = labeldata("CartID")
address = address & vbCrLf & labeldata("Name") & vbCrLf &
labeldata("Address") & vbCrLf & labeldata("PostCode") & vbCrLf &
labeldata("Country")

labeldata.Close()
set labeldata = nothing

set app = createobject("Word.Application")
app.Application.Visible = True
app.Documents.Add()
app.Selection.TypeText(address)
app.Selection.WholeStory()
app.Application.MailingLabel.DefaultPrintBarCode = False
app.Application.MailingLabel.PrintOut "2160 Mini", firstline,
wdPrinterManualFeed, true, 1, 1

Call CloseDBConnection()
%>

This works fine with my localhost IIS5, however, I suspect that when I
transfer this to the webserver, it's gonna try and run Word on the server.
What we wanna do is run the code on the server, so that it loads Word on the
client machine and prints the labels.

How can this be done? Any help greatly appreciated!

Cheers


Dan
 
A

Aaron Bertrand [MVP]

What we wanna do is run the code on the server, so that it loads Word on
the
client machine and prints the labels.

This is a contradiction. You can't run code on the server that even thinks
about touching Word on the client (yes, even in an Intranet scenario). You
need a client-server application, not a web page, to do this.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top