B
Bill Kuunders
Working with network prionters it has been a problem to tell excel which
port the printer is on. I.e. either Ne01, Ne02, Ne03 or Ne04.
E Ehren came up with a solution ,,, looping through the possible numbers
untill there was a match. This works fine in excel.
Used the same code to prevent the problem in a word macro.
It appears that word can intuitively pick up the right number.
The word macro .................
oldpname = Application.ActivePrinter 'at this stage printer is the default
inkjet printer
__don't need this__For j = 0 To 9
__don't need this__On Error Resume Next
__don't need this__temppname = "\\nzdfprn01\Label_UHT_Sato on Ne0" & j & ":"
instead use this..................
temppname = "\\nzdfprn01\Label_UHT_Sato "
Application.ActivePrinter = temppname 'it selects the right printer here
'application
active printer is now the sato label printer on Ne03 for instance
__don't need this__If Application.ActivePrinter = temppname Then
__don't need this__Exit For
__don't need this__End If
__don't need this__Next j
printlabel
Application.ActivePrinter = oldpname
End Sub
The lines with __don't need this__ are necessary in the excel macro to be
able to find the right number.
Is there another way for excel to make it "smarter"?
I don't like to have to accept that word is smarter.
Regards
Bill Kuunders
port the printer is on. I.e. either Ne01, Ne02, Ne03 or Ne04.
E Ehren came up with a solution ,,, looping through the possible numbers
untill there was a match. This works fine in excel.
Used the same code to prevent the problem in a word macro.
It appears that word can intuitively pick up the right number.
The word macro .................
oldpname = Application.ActivePrinter 'at this stage printer is the default
inkjet printer
__don't need this__For j = 0 To 9
__don't need this__On Error Resume Next
__don't need this__temppname = "\\nzdfprn01\Label_UHT_Sato on Ne0" & j & ":"
instead use this..................
temppname = "\\nzdfprn01\Label_UHT_Sato "
Application.ActivePrinter = temppname 'it selects the right printer here
'application
active printer is now the sato label printer on Ne03 for instance
__don't need this__If Application.ActivePrinter = temppname Then
__don't need this__Exit For
__don't need this__End If
__don't need this__Next j
printlabel
Application.ActivePrinter = oldpname
End Sub
The lines with __don't need this__ are necessary in the excel macro to be
able to find the right number.
Is there another way for excel to make it "smarter"?
I don't like to have to accept that word is smarter.
Regards
Bill Kuunders