Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer Object in Visual Basic

Status
Not open for further replies.

SpeedBWild

Programmer
Joined
Apr 29, 2004
Messages
117
Location
US
I am trying to print from an ASP to a selected printer using an ActiveX dll. I am able to pass into the COM object the printer I want to print to. Once inside the COM object I change the default printer to the printer I want to print to. This works fine.
I then begin to use the default printer properties to set the FontName, FontSize, etc...
So once the default printer is set I then do the following:
Printer.ScaleMode = 5 '(vbInches)Printer.Orientation=2 '(vbPRORLandscape)
Printer.PaperBin=4 '(vbPRBNManual)
Printer.CurrentX = 1
Printer.CurrentY = 5-Printer.TextHeight("String")
sWrittenData ="Some string of data"
Printer.Print sWrittenData
Printer.EndDoc
The problem is that if I am on the actual server running the ASP page, the COM object runs and prints the data to the correct printer selected. If I am on the client and call the ASP page I get the following error: Printer Error 482. I have added some debug code and found that for some reason it does not like the printer object when begin run from the client machine. Is there a way around this? Is there something I forgot to set. I am very new to working with printers so any help would be greatly apprecitated.

Thank you,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top