Results 1 to 8 of 8

Thread: Print to a remote printer

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Virginia Beach
    Posts
    66

    Question

    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

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    Does it HAVE to use SMTP or IP? Because using a CDL would be a breeze!
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Virginia Beach
    Posts
    66
    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?

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    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)


    ?
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  5. #5
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    And the drivers for the instructor's printer will most likely have to be installed on the pc your friend is using.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Virginia Beach
    Posts
    66
    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

  7. #7
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    No
    The CDL Will not see the printer over a dial up network.
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  8. #8
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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
    <removed by admin>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width