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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the Printers Collection to Manipulate Print Jobs

Status
Not open for further replies.

pgk

Programmer
Jul 19, 2002
262
US
Hi Folks,

1) I tried using the Printers collection in VB to select a particular printer and the KillDoc method to kill the current print job.

But it says the Object does not support the Method or Property ( Runtime Error 438 ).

I have also posted the code snippet that I tried. Please take look at it and let me know what is to be done.

Dim prnt as Printer
Private Sub List1_Click()
Set prnt = Printers(List1.Selected(List1.ListIndex + 1))
prnt.KillDoc
End Sub

I select the printer from the list ( List1 )and this is to kill the document immediately.

2) Also is there some way for me to list all the jobs that are currently queued up in the printer?


Thanks in advance.
Hope it helps. Let me know what happens.
With regards,
PGK
 
I'm not sure that the snippet was written this way ...

Go to TOOLS>OPTIONS>EDITOR (Tab)

Make sure the AUTO LIST MEMBERS checkbox is TRUE.

Now try writting the 'PRINT.' and see if the KILLDOC is listed in the listbox that will appear.

If it doesn't appear then it means that the command PRINT that you're using is not valid.

Now try writting 'PRINTER.' and type KILLDOC to set it right.


Hope that helped.

Random is what we can't see
Devine is what we can't understand
and If 1=2 then I'm the pope
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top