Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   VB script in Word for Printing (http://www.go4expert.com/forums/vb-script-word-printing-t823/)

claudia 23May2006 05:48

VB script in Word for Printing
 
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?

shabbir 24May2006 11:20

Re: VB script in Word for Printing
 
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.

claudia 24May2006 21:05

Re: VB script in Word for Printing
 
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

shabbir 25May2006 15:00

Re: VB script in Word for Printing
 
Why dont you install the same network printer object locally instead of accessing the printer on the network.


All times are GMT +5.5. The time now is 03:29.