VB script in Word for Printing

Discussion in 'Visual Basic ( VB )' started by claudia, May 23, 2006.

  1. claudia

    claudia New Member

    Joined:
    May 22, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I have put a script in Word to print to a certain printer each time. This printer in this example is a label printer.
    This is the following script

    Option Explicit
    Private sub Document Open()
    With Dialogs(wdDialogFilePrintSetup)
    .Printer = "labelprinter name"
    .DoNotSetAsSysDefault = True
    End With
    End Sub

    we are using remote desktop to a server and the label printer name shows listed on the server as sc_label on Desktop2. If I put that name in, the script doesn't work. This printer is not connect to a print server like the other printers but to a PC. I can use one of the printers that is on a print server and the script works fine. Any ideas?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I guess you are missing a point here.

    If you wish to use the printer of the server you need to either installed the share copy of the printer driver on your machine or access the printer through the name/ip as "\\<ipaddress>\<SharePrinterName>\". Correct me if I am wrong.
     
  3. claudia

    claudia New Member

    Joined:
    May 22, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    shabbir
    The printer is Listed on the server as "sc_label on FRONTDESK2" it is a USB printer on PC. The share name is "sc_label". When I look at the properties on the printer it shows the port to be USB001. I have tried doe "\\FRONTDESK2\sc_label" and that didn't work. And just "sc_label" and that didnt work. Any other ides? Thanks for the help Claudia
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Why dont you install the same network printer object locally instead of accessing the printer on the network.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice