-
I am asking this question for a friend that has a problem to complete for his VB class. He needs to write code that allows him to print on his instructors printer using either SMTP or IP. An example of the code would be greatly appreciated, he has tried everything he can think of and had no luck.
thanks,
Cady
-
Does it HAVE to use SMTP or IP? Because using a CDL would be a breeze!
-
Lee M., I'm not sure. Could you post how to do it with a CDL and I will pass that info on to him. By now I would like to know how to do this also, just out of curiosity. Do you also know how to do it with SMTP or IP?
-
Add a common dialog control to the form
cdl1.showprinter
It will know the printers on the network, provided they are shared at your level.
Otherwise you would have to know the printers name, or you could use the DefaultPrinter
Dim pr As Printer
Set Printer = Printers(Printer Name)
?
-
And the drivers for the instructor's printer will most likely have to be installed on the pc your friend is using.
-
Ok, he will be writing this code from his computer at home, and printing to his instructors printer, I assume in his class room. So they won't be on the same Network. Will the commondialog control still work, and what all does he need to know about the printer. I assume he will need the IP address of the printer. What about the name or address of the Server the printer is connected to?
dim pr as Printer
Set Printer = Printers(PrinterName)
if you just put the IP address of the printer for the PrinterName, would that work?
Thanks for your help!
Cady
-
No
The CDL Will not see the printer over a dial up network.
-
If he has a static IP and filesharing on, you can just go to add printer in the control panel, choose a network printer, type in \\IP Address\Printer Name, and his printer name, like ClassHP or somthing along those lines. Then you can set it as default, and just use the printer.print command to print to his printer. I've used it many times to mess with my friends heads. They think their printer is possessed. hehe :D