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
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